diff --git a/crates/solidity/inputs/language/src/definition.rs b/crates/solidity/inputs/language/src/definition.rs index 3e940a73be..66bd5fb447 100644 --- a/crates/solidity/inputs/language/src/definition.rs +++ b/crates/solidity/inputs/language/src/definition.rs @@ -1224,6 +1224,7 @@ codegen_language_macros::compile!(Language( name = OverrideKeyword, identifier = Identifier, definitions = [KeywordDefinition( + enabled = From("0.6.0"), reserved = From("0.5.0"), value = Atom("override") )] @@ -2258,7 +2259,7 @@ codegen_language_macros::compile!(Language( Enum( name = StateVariableAttribute, variants = [ - EnumVariant(reference = OverrideSpecifier), + EnumVariant(reference = OverrideSpecifier, enabled = From("0.6.0")), EnumVariant(reference = ConstantKeyword), EnumVariant(reference = InternalKeyword), EnumVariant(reference = PrivateKeyword), @@ -2325,7 +2326,7 @@ codegen_language_macros::compile!(Language( name = FunctionAttribute, variants = [ EnumVariant(reference = ModifierInvocation), - EnumVariant(reference = OverrideSpecifier), + EnumVariant(reference = OverrideSpecifier, enabled = From("0.6.0")), EnumVariant(reference = ConstantKeyword, enabled = Till("0.5.0")), EnumVariant(reference = ExternalKeyword), EnumVariant(reference = InternalKeyword), @@ -2339,6 +2340,7 @@ codegen_language_macros::compile!(Language( ), Struct( name = OverrideSpecifier, + enabled = From("0.6.0"), fields = ( override_keyword = Required(OverrideKeyword), overridden = Optional(reference = OverridePathsDeclaration) @@ -2346,6 +2348,7 @@ codegen_language_macros::compile!(Language( ), Struct( name = OverridePathsDeclaration, + enabled = From("0.6.0"), error_recovery = FieldsErrorRecovery( delimiters = FieldDelimiters(open = open_paren, close = close_paren) @@ -2359,7 +2362,8 @@ codegen_language_macros::compile!(Language( Separated( name = OverridePaths, reference = IdentifierPath, - separator = Comma + separator = Comma, + enabled = From("0.6.0") ), Struct( name = ReturnsDeclaration, @@ -2430,7 +2434,6 @@ codegen_language_macros::compile!(Language( enabled = Till("0.6.0"), variants = [ EnumVariant(reference = ModifierInvocation), - EnumVariant(reference = OverrideSpecifier), EnumVariant(reference = ConstantKeyword, enabled = Till("0.5.0")), EnumVariant(reference = ExternalKeyword), EnumVariant(reference = InternalKeyword, enabled = Till("0.5.0")), @@ -2527,7 +2530,7 @@ codegen_language_macros::compile!(Language( Enum( name = ModifierAttribute, variants = [ - EnumVariant(reference = OverrideSpecifier), + EnumVariant(reference = OverrideSpecifier, enabled = From("0.6.0")), EnumVariant(reference = VirtualKeyword, enabled = From("0.6.0")) ] ), diff --git a/crates/solidity/outputs/cargo/slang_solidity/src/generated/language.rs b/crates/solidity/outputs/cargo/slang_solidity/src/generated/language.rs index 35382d6c00..f863eff151 100644 --- a/crates/solidity/outputs/cargo/slang_solidity/src/generated/language.rs +++ b/crates/solidity/outputs/cargo/slang_solidity/src/generated/language.rs @@ -2508,8 +2508,10 @@ impl Language { 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_6_0 { + 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, @@ -3374,8 +3376,10 @@ impl Language { #[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.override_specifier(input); + choice.consider(input, result)?; + } if self.version_is_at_least_0_6_0 { let result = self.parse_token_with_trivia::( input, @@ -3701,66 +3705,78 @@ impl Language { #[allow(unused_assignments, unused_parens)] fn override_paths(&self, input: &mut ParserContext<'_>) -> ParserResult { - SeparatedHelper::run::<_, LexicalContextType::Default>( - input, - self, - |input| self.identifier_path(input).with_label(NodeLabel::Item), - TokenKind::Comma, - NodeLabel::Separator, - ) + if self.version_is_at_least_0_6_0 { + SeparatedHelper::run::<_, LexicalContextType::Default>( + input, + self, + |input| self.identifier_path(input).with_label(NodeLabel::Item), + TokenKind::Comma, + NodeLabel::Separator, + ) + } else { + ParserResult::disabled() + } .with_kind(RuleKind::OverridePaths) } #[allow(unused_assignments, unused_parens)] fn override_paths_declaration(&self, input: &mut ParserContext<'_>) -> ParserResult { - SequenceHelper::run(|mut seq| { - let mut delim_guard = input.open_delim(TokenKind::CloseParen); - let input = delim_guard.ctx(); - seq.elem_labeled( - NodeLabel::OpenParen, - self.parse_token_with_trivia::( - input, - TokenKind::OpenParen, - ), - )?; - seq.elem( - self.override_paths(input) - .with_label(NodeLabel::Paths) - .recover_until_with_nested_delims::<_, LexicalContextType::Default>( + if self.version_is_at_least_0_6_0 { + SequenceHelper::run(|mut seq| { + let mut delim_guard = input.open_delim(TokenKind::CloseParen); + let input = delim_guard.ctx(); + seq.elem_labeled( + NodeLabel::OpenParen, + self.parse_token_with_trivia::( + input, + TokenKind::OpenParen, + ), + )?; + seq.elem( + self.override_paths(input) + .with_label(NodeLabel::Paths) + .recover_until_with_nested_delims::<_, LexicalContextType::Default>( input, self, TokenKind::CloseParen, TokenAcceptanceThreshold(0u8), ), - )?; - seq.elem_labeled( - NodeLabel::CloseParen, - self.parse_token_with_trivia::( - input, - TokenKind::CloseParen, - ), - )?; - seq.finish() - }) + )?; + seq.elem_labeled( + NodeLabel::CloseParen, + self.parse_token_with_trivia::( + input, + TokenKind::CloseParen, + ), + )?; + seq.finish() + }) + } else { + ParserResult::disabled() + } .with_kind(RuleKind::OverridePathsDeclaration) } #[allow(unused_assignments, unused_parens)] fn override_specifier(&self, input: &mut ParserContext<'_>) -> ParserResult { - SequenceHelper::run(|mut seq| { - seq.elem_labeled( - NodeLabel::OverrideKeyword, - self.parse_token_with_trivia::( - input, - TokenKind::OverrideKeyword, - ), - )?; - seq.elem_labeled( - NodeLabel::Overridden, - OptionalHelper::transform(self.override_paths_declaration(input)), - )?; - seq.finish() - }) + if self.version_is_at_least_0_6_0 { + SequenceHelper::run(|mut seq| { + seq.elem_labeled( + NodeLabel::OverrideKeyword, + self.parse_token_with_trivia::( + input, + TokenKind::OverrideKeyword, + ), + )?; + seq.elem_labeled( + NodeLabel::Overridden, + OptionalHelper::transform(self.override_paths_declaration(input)), + )?; + seq.finish() + }) + } else { + ParserResult::disabled() + } .with_kind(RuleKind::OverrideSpecifier) } @@ -4243,8 +4259,10 @@ impl Language { #[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)?; + if self.version_is_at_least_0_6_0 { + let result = self.override_specifier(input); + choice.consider(input, result)?; + } let result = self.parse_token_with_trivia::( input, TokenKind::ConstantKeyword, @@ -5004,8 +5022,6 @@ impl Language { 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, @@ -10181,8 +10197,10 @@ impl Lexer for Language { if scan_chars!(input, 'e', 'r', 'r', 'i', 'd', 'e') { if self.version_is_at_least_0_5_0 { KeywordScan::Reserved(TokenKind::OverrideKeyword) - } else { + } else if self.version_is_at_least_0_6_0 { KeywordScan::Present(TokenKind::OverrideKeyword) + } else { + KeywordScan::Absent } } else { KeywordScan::Absent diff --git a/crates/solidity/outputs/cargo/slang_solidity/src/generated/napi_interface/ast_selectors.rs b/crates/solidity/outputs/cargo/slang_solidity/src/generated/napi_interface/ast_selectors.rs index f754a00c5b..13c7f46e39 100644 --- a/crates/solidity/outputs/cargo/slang_solidity/src/generated/napi_interface/ast_selectors.rs +++ b/crates/solidity/outputs/cargo/slang_solidity/src/generated/napi_interface/ast_selectors.rs @@ -1744,7 +1744,7 @@ impl Selector { impl Selector { fn unnamed_function_attribute(&mut self) -> Result { self.select(|node| { - node.is_rule_with_kinds(&[RuleKind::ModifierInvocation, RuleKind::OverrideSpecifier]) + node.is_rule_with_kind(RuleKind::ModifierInvocation) || node.is_token_with_kinds(&[ TokenKind::ConstantKeyword, TokenKind::ExternalKeyword, diff --git a/crates/solidity/outputs/cargo/tests/src/cst_output/generated/mod.rs b/crates/solidity/outputs/cargo/tests/src/cst_output/generated/mod.rs index ab2d8c72bc..7596da4a3d 100644 --- a/crates/solidity/outputs/cargo/tests/src/cst_output/generated/mod.rs +++ b/crates/solidity/outputs/cargo/tests/src/cst_output/generated/mod.rs @@ -24,6 +24,7 @@ mod hex_string_literals; mod import_directive; mod interface_definition; mod mapping_type; +mod modifier_definition; mod new_expression; mod pragma_directive; mod receive_function_definition; diff --git a/crates/solidity/outputs/cargo/tests/src/cst_output/generated/modifier_definition.rs b/crates/solidity/outputs/cargo/tests/src/cst_output/generated/modifier_definition.rs new file mode 100644 index 0000000000..1894da1ee5 --- /dev/null +++ b/crates/solidity/outputs/cargo/tests/src/cst_output/generated/modifier_definition.rs @@ -0,0 +1,10 @@ +// This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +use anyhow::Result; + +use crate::cst_output::runner::run; + +#[test] +fn override_attr() -> Result<()> { + run("ModifierDefinition", "override_attr") +} diff --git a/crates/solidity/outputs/npm/package/src/ast/generated/ast_types.ts b/crates/solidity/outputs/npm/package/src/ast/generated/ast_types.ts index cfa6468174..b85a9e15b2 100644 --- a/crates/solidity/outputs/npm/package/src/ast/generated/ast_types.ts +++ b/crates/solidity/outputs/npm/package/src/ast/generated/ast_types.ts @@ -4226,14 +4226,12 @@ export class ConstructorAttribute { } export class UnnamedFunctionAttribute { - private readonly fetch: () => ModifierInvocation | OverrideSpecifier | TokenNode = once(() => { + private readonly fetch: () => ModifierInvocation | TokenNode = once(() => { const variant = ast_internal.selectChoice(this.cst); switch (variant.kind) { case RuleKind.ModifierInvocation: return new ModifierInvocation(variant as RuleNode); - case RuleKind.OverrideSpecifier: - return new OverrideSpecifier(variant as RuleNode); case TokenKind.ConstantKeyword: case TokenKind.ExternalKeyword: @@ -4254,7 +4252,7 @@ export class UnnamedFunctionAttribute { assertKind(this.cst.kind, RuleKind.UnnamedFunctionAttribute); } - public get variant(): ModifierInvocation | OverrideSpecifier | TokenNode { + public get variant(): ModifierInvocation | TokenNode { return this.fetch(); } } diff --git a/crates/solidity/outputs/spec/generated/grammar.ebnf b/crates/solidity/outputs/spec/generated/grammar.ebnf index 8077c38dc3..9b4bbf0b18 100644 --- a/crates/solidity/outputs/spec/generated/grammar.ebnf +++ b/crates/solidity/outputs/spec/generated/grammar.ebnf @@ -345,6 +345,7 @@ NULL_KEYWORD = "null"; OF_KEYWORD = "of"; +(* Introduced in 0.6.0 *) (* Reserved in 0.5.0 *) OVERRIDE_KEYWORD = "override"; @@ -669,7 +670,7 @@ StateVariableDefinitionValue = EQUAL StateVariableAttributes = StateVariableAttribute*; -StateVariableAttribute = OverrideSpecifier +StateVariableAttribute = OverrideSpecifier (* Introduced in 0.6.0 *) | CONSTANT_KEYWORD | INTERNAL_KEYWORD | PRIVATE_KEYWORD @@ -702,7 +703,7 @@ Parameter = TypeName FunctionAttributes = FunctionAttribute*; FunctionAttribute = ModifierInvocation - | OverrideSpecifier + | OverrideSpecifier (* Introduced in 0.6.0 *) | CONSTANT_KEYWORD (* Deprecated in 0.5.0 *) | EXTERNAL_KEYWORD | INTERNAL_KEYWORD @@ -713,13 +714,16 @@ FunctionAttribute = ModifierInvocation | VIEW_KEYWORD (* Introduced in 0.4.16 *) | VIRTUAL_KEYWORD; (* Introduced in 0.6.0 *) +(* Introduced in 0.6.0 *) OverrideSpecifier = OVERRIDE_KEYWORD OverridePathsDeclaration?; +(* Introduced in 0.6.0 *) OverridePathsDeclaration = OPEN_PAREN OverridePaths CLOSE_PAREN; +(* Introduced in 0.6.0 *) OverridePaths = IdentifierPath (COMMA IdentifierPath)*; ReturnsDeclaration = RETURNS_KEYWORD @@ -756,7 +760,6 @@ UnnamedFunctionAttributes = UnnamedFunctionAttribute*; (* Deprecated in 0.6.0 *) UnnamedFunctionAttribute = ModifierInvocation - | OverrideSpecifier | CONSTANT_KEYWORD (* Deprecated in 0.5.0 *) | EXTERNAL_KEYWORD | INTERNAL_KEYWORD (* Deprecated in 0.5.0 *) @@ -811,7 +814,7 @@ ModifierDefinition = MODIFIER_KEYWORD ModifierAttributes = ModifierAttribute*; -ModifierAttribute = OverrideSpecifier +ModifierAttribute = OverrideSpecifier (* Introduced in 0.6.0 *) | VIRTUAL_KEYWORD; (* Introduced in 0.6.0 *) ModifierInvocation = IdentifierPath diff --git a/crates/solidity/outputs/spec/generated/public/01-file-structure/08-keywords.md b/crates/solidity/outputs/spec/generated/public/01-file-structure/08-keywords.md index f3ea774ac1..caa7701b96 100644 --- a/crates/solidity/outputs/spec/generated/public/01-file-structure/08-keywords.md +++ b/crates/solidity/outputs/spec/generated/public/01-file-structure/08-keywords.md @@ -416,7 +416,7 @@ ``` -
(* Reserved in 0.5.0 *)
OVERRIDE_KEYWORD = "override";
+
(* Introduced in 0.6.0 *)
(* Reserved in 0.5.0 *)
OVERRIDE_KEYWORD = "override";
```{ .ebnf #PartialKeyword } diff --git a/crates/solidity/outputs/spec/generated/public/02-definitions/07-state-variables.md b/crates/solidity/outputs/spec/generated/public/02-definitions/07-state-variables.md index 490469108d..9c147a41c7 100644 --- a/crates/solidity/outputs/spec/generated/public/02-definitions/07-state-variables.md +++ b/crates/solidity/outputs/spec/generated/public/02-definitions/07-state-variables.md @@ -26,6 +26,6 @@ ``` -
StateVariableAttribute = OverrideSpecifier
| CONSTANT_KEYWORD
| INTERNAL_KEYWORD
| PRIVATE_KEYWORD
| PUBLIC_KEYWORD
| IMMUTABLE_KEYWORD; (* Introduced in 0.6.5 *)
+
StateVariableAttribute = OverrideSpecifier (* Introduced in 0.6.0 *)
| CONSTANT_KEYWORD
| INTERNAL_KEYWORD
| PRIVATE_KEYWORD
| PUBLIC_KEYWORD
| IMMUTABLE_KEYWORD; (* Introduced in 0.6.5 *)
--8<-- "crates/solidity/inputs/language/docs/02-definitions/07-state-variables.md" diff --git a/crates/solidity/outputs/spec/generated/public/02-definitions/08-functions.md b/crates/solidity/outputs/spec/generated/public/02-definitions/08-functions.md index ac5fdf911f..8298e13355 100644 --- a/crates/solidity/outputs/spec/generated/public/02-definitions/08-functions.md +++ b/crates/solidity/outputs/spec/generated/public/02-definitions/08-functions.md @@ -44,25 +44,25 @@ ``` -
FunctionAttribute = ModifierInvocation
| OverrideSpecifier
| CONSTANT_KEYWORD (* Deprecated in 0.5.0 *)
| EXTERNAL_KEYWORD
| INTERNAL_KEYWORD
| PAYABLE_KEYWORD
| PRIVATE_KEYWORD
| PUBLIC_KEYWORD
| PURE_KEYWORD (* Introduced in 0.4.16 *)
| VIEW_KEYWORD (* Introduced in 0.4.16 *)
| VIRTUAL_KEYWORD; (* Introduced in 0.6.0 *)
+
FunctionAttribute = ModifierInvocation
| OverrideSpecifier (* Introduced in 0.6.0 *)
| CONSTANT_KEYWORD (* Deprecated in 0.5.0 *)
| EXTERNAL_KEYWORD
| INTERNAL_KEYWORD
| PAYABLE_KEYWORD
| PRIVATE_KEYWORD
| PUBLIC_KEYWORD
| PURE_KEYWORD (* Introduced in 0.4.16 *)
| VIEW_KEYWORD (* Introduced in 0.4.16 *)
| VIRTUAL_KEYWORD; (* Introduced in 0.6.0 *)
```{ .ebnf #OverrideSpecifier } ``` -
OverrideSpecifier = OVERRIDE_KEYWORD
OverridePathsDeclaration?;
+
(* Introduced in 0.6.0 *)
OverrideSpecifier = OVERRIDE_KEYWORD
OverridePathsDeclaration?;
```{ .ebnf #OverridePathsDeclaration } ``` -
OverridePathsDeclaration = OPEN_PAREN
OverridePaths
CLOSE_PAREN;
+
(* Introduced in 0.6.0 *)
OverridePathsDeclaration = OPEN_PAREN
OverridePaths
CLOSE_PAREN;
```{ .ebnf #OverridePaths } ``` -
OverridePaths = IdentifierPath (COMMA IdentifierPath)*;
+
(* Introduced in 0.6.0 *)
OverridePaths = IdentifierPath (COMMA IdentifierPath)*;
```{ .ebnf #ReturnsDeclaration } @@ -110,7 +110,7 @@ ``` -
(* Deprecated in 0.6.0 *)
UnnamedFunctionAttribute = ModifierInvocation
| OverrideSpecifier
| CONSTANT_KEYWORD (* Deprecated in 0.5.0 *)
| EXTERNAL_KEYWORD
| INTERNAL_KEYWORD (* Deprecated in 0.5.0 *)
| PAYABLE_KEYWORD
| PRIVATE_KEYWORD (* Deprecated in 0.5.0 *)
| PUBLIC_KEYWORD (* Deprecated in 0.5.0 *)
| PURE_KEYWORD (* Introduced in 0.4.16 and deprecated in 0.6.0. *)
| VIEW_KEYWORD; (* Introduced in 0.4.16 and deprecated in 0.6.0. *)
+
(* Deprecated in 0.6.0 *)
UnnamedFunctionAttribute = ModifierInvocation
| CONSTANT_KEYWORD (* Deprecated in 0.5.0 *)
| EXTERNAL_KEYWORD
| INTERNAL_KEYWORD (* Deprecated in 0.5.0 *)
| PAYABLE_KEYWORD
| PRIVATE_KEYWORD (* Deprecated in 0.5.0 *)
| PUBLIC_KEYWORD (* Deprecated in 0.5.0 *)
| PURE_KEYWORD (* Introduced in 0.4.16 and deprecated in 0.6.0. *)
| VIEW_KEYWORD; (* Introduced in 0.4.16 and deprecated in 0.6.0. *)
```{ .ebnf #FallbackFunctionDefinition } diff --git a/crates/solidity/outputs/spec/generated/public/02-definitions/09-modifiers.md b/crates/solidity/outputs/spec/generated/public/02-definitions/09-modifiers.md index 40079030f9..37cee74499 100644 --- a/crates/solidity/outputs/spec/generated/public/02-definitions/09-modifiers.md +++ b/crates/solidity/outputs/spec/generated/public/02-definitions/09-modifiers.md @@ -20,7 +20,7 @@ ``` -
ModifierAttribute = OverrideSpecifier
| VIRTUAL_KEYWORD; (* Introduced in 0.6.0 *)
+
ModifierAttribute = OverrideSpecifier (* Introduced in 0.6.0 *)
| VIRTUAL_KEYWORD; (* Introduced in 0.6.0 *)
```{ .ebnf #ModifierInvocation } diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/constructor_contextual/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/constructor_contextual/generated/0.4.11-failure.yml index ae09fb1ecc..3d2742fc2a 100644 --- a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/constructor_contextual/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/constructor_contextual/generated/0.4.11-failure.yml @@ -12,7 +12,7 @@ Source: > Errors: # 1 total - > - Error: Expected ConstantKeyword or Identifier or InternalKeyword or OverrideKeyword or PrivateKeyword or PublicKeyword. + Error: Expected ConstantKeyword or Identifier or InternalKeyword or PrivateKeyword or PublicKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/constructor_contextual/input.sol:4:13] │ 4 │ ╭─▶ constructor() {} 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 573dc66915..50a5158262 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 @@ -8,7 +8,7 @@ Source: > Errors: # 1 total - > - Error: Expected ConstantKeyword or Identifier or InternalKeyword or OverrideKeyword or PrivateKeyword or PublicKeyword. + Error: Expected ConstantKeyword or Identifier or InternalKeyword or PrivateKeyword or PublicKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_constructor_definition/input.sol:2:14] │ 2 │ ╭─▶ constructor() public { 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 2a5247bceb..ecbc5f8281 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 @@ -8,7 +8,7 @@ Source: > Errors: # 1 total - > - Error: Expected ConstantKeyword or Identifier or InternalKeyword or OverrideKeyword or PrivateKeyword or PublicKeyword. + Error: Expected ConstantKeyword or Identifier or InternalKeyword or PrivateKeyword or PublicKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_fallback_function_definition/input.sol:2:11] │ 2 │ ╭─▶ fallback() { 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 e22e128a50..c991f0e267 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 @@ -8,7 +8,7 @@ Source: > Errors: # 1 total - > - Error: Expected ConstantKeyword or Identifier or InternalKeyword or OverrideKeyword or PrivateKeyword or PublicKeyword. + Error: Expected ConstantKeyword or Identifier or InternalKeyword or PrivateKeyword or PublicKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/member_receive_function_definition/input.sol:2:10] │ 2 │ ╭─▶ receive() { 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 89c4fb1db7..3e3a469572 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 @@ -7,7 +7,7 @@ Source: > Errors: # 1 total - > - Error: Expected ConstantKeyword or Identifier or InternalKeyword or OverrideKeyword or PrivateKeyword or PublicKeyword. + Error: Expected ConstantKeyword or Identifier or InternalKeyword or PrivateKeyword or PublicKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/missing_field_type/input.sol:2:8] │ 2 │ field; diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/missing_field_type/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/missing_field_type/generated/0.6.0-failure.yml new file mode 100644 index 0000000000..89c4fb1db7 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/missing_field_type/generated/0.6.0-failure.yml @@ -0,0 +1,36 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ contract Test { │ 0..15 + 2 │ field; │ 16..24 + 3 │ } │ 25..26 + +Errors: # 1 total + - > + Error: Expected ConstantKeyword or Identifier or InternalKeyword or OverrideKeyword or PrivateKeyword or PublicKeyword. + ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/missing_field_type/input.sol:2:8] + │ + 2 │ field; + │ │ + │ ╰─ Error occurred here. + ───╯ + +Tree: + - (ContractDefinition): # "contract Test {\n field;\n}\n" (0..27) + - (contract_keyword꞉ ContractKeyword): "contract" # (0..8) + - (leading_trivia꞉ Whitespace): " " # (8..9) + - (name꞉ Identifier): "Test" # (9..13) + - (leading_trivia꞉ Whitespace): " " # (13..14) + - (open_brace꞉ OpenBrace): "{" # (14..15) + - (trailing_trivia꞉ EndOfLine): "\n" # (15..16) + - (members꞉ ContractMembers): # " field;\n" (16..25) + - (item꞉ ContractMember) ► (variant꞉ StateVariableDefinition): # " field;\n" (16..25) + - (type_name꞉ TypeName) ► (variant꞉ IdentifierPath): # " field" (16..23) + - (leading_trivia꞉ Whitespace): " " # (16..18) + - (item꞉ Identifier): "field" # (18..23) + - (attributes꞉ StateVariableAttributes): [] # (23..23) + - (SKIPPED): "" # (23..23) + - (semicolon꞉ Semicolon): ";" # (23..24) + - (trailing_trivia꞉ EndOfLine): "\n" # (24..25) + - (close_brace꞉ CloseBrace): "}" # (25..26) + - (trailing_trivia꞉ EndOfLine): "\n" # (26..27) 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 b1f51f7c4f..99f0b3d42b 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 @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected ConstantKeyword or Identifier or InternalKeyword or OverrideKeyword or PrivateKeyword or PublicKeyword. + Error: Expected ConstantKeyword or Identifier or InternalKeyword or PrivateKeyword or PublicKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembers/constructor/input.sol:1:12] │ 1 │ constructor() public {} 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 8cd98404b2..3abecfe41a 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 @@ -14,91 +14,21 @@ Source: > 11 │ function nested_lists() override(some.ident, next.do.that, other.while, next.one, final, ultimate); │ 389..488 12 │ function nested_lists() override(some., next.arg, next.one, ultimate); │ 489..559 -Errors: # 10 total +Errors: # 1 total - > - Error: Expected CloseParen or Comma. - ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/input.sol:1:36] - │ - 1 │ function all() override(some.ident unexpected tokens, ISomeInterface, Other) public { - │ ────────────────────┬─────────────────── - │ ╰───────────────────── Error occurred here. - ───╯ - - > - Error: Expected Semicolon. - ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/input.sol:2:18] - │ - 2 │ msg.sender.call{do: 1, arg: 1 }(); - │ ─────────┬──────── - │ ╰────────── Error occurred here. - ───╯ - - > - Error: Expected Semicolon. - ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/input.sol:3:18] - │ - 3 │ msg.sender.call{, empty: 1, parse: 2 }(); - │ ────────────┬──────────── - │ ╰────────────── Error occurred here. - ───╯ - - > - Error: Expected Semicolon. - ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/input.sol:4:18] - │ - 4 │ msg.sender.call{arg: 1, missing_expr: , no_semicolon, , }(); - │ ──────────────────────┬───────────────────── - │ ╰─────────────────────── Error occurred here. - ───╯ - - > - Error: Expected Semicolon. - ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/input.sol:5:18] - │ - 5 │ msg.sender.call{arg: 1 unexpected tokens, not: 2, recovered, yet: 3, }(); - │ ────────────────────────────┬──────────────────────────── - │ ╰────────────────────────────── Error occurred here. - ───╯ - - > - Error: Expected Identifier. - ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/input.sol:9:50] - │ - 9 │ function empty() override(some.ident, /* empty */, other.arg.here, and.here); - │ ─────────────┬──────────── - │ ╰────────────── Error occurred here. - ───╯ - - > - Error: Expected Identifier. - ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/input.sol:11:51] - │ - 11 │ function nested_lists() override(some.ident, next.do.that, other.while, next.one, final, ultimate); - │ ───┬─── - │ ╰───── Error occurred here. - ────╯ - - > - Error: Expected Identifier. - ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/input.sol:11:66] - │ - 11 │ function nested_lists() override(some.ident, next.do.that, other.while, next.one, final, ultimate); - │ ──┬── - │ ╰──── Error occurred here. - ────╯ - - > - Error: Expected Identifier. - ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/input.sol:11:83] - │ - 11 │ function nested_lists() override(some.ident, next.do.that, other.while, next.one, final, ultimate); - │ ───────┬─────── - │ ╰───────── Error occurred here. - ────╯ - - > - Error: Expected Identifier. - ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/input.sol:12:39] + Error: Expected OpenBrace or ReturnsKeyword or Semicolon. + ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/input.sol:1:15] │ - 12 │ function nested_lists() override(some., next.arg, next.one, ultimate); - │ │ - │ ╰─ Error occurred here. + 1 │ ╭─▶ function all() override(some.ident unexpected tokens, ISomeInterface, Other) public { + ┆ ┆ + 12 │ ├─▶ function nested_lists() override(some., next.arg, next.one, ultimate); + │ │ + │ ╰──────────────────────────────────────────────────────────────────────────── Error occurred here. ────╯ Tree: - (ContractMembers): # "function all() override(some.ident unexpected toke..." (0..560) - - (item꞉ ContractMember) ► (variant꞉ FunctionDefinition): # "function all() override(some.ident unexpected toke..." (0..309) + - (item꞉ ContractMember) ► (variant꞉ FunctionDefinition): # "function all()" (0..14) - (function_keyword꞉ FunctionKeyword): "function" # (0..8) - (name꞉ FunctionName): # " all" (8..12) - (leading_trivia꞉ Whitespace): " " # (8..9) @@ -107,195 +37,5 @@ Tree: - (open_paren꞉ OpenParen): "(" # (12..13) - (parameters꞉ Parameters): [] # (13..13) - (close_paren꞉ CloseParen): ")" # (13..14) - - (attributes꞉ FunctionAttributes): # " override(some.ident unexpected tokens, ISomeInter..." (14..83) - - (item꞉ FunctionAttribute) ► (variant꞉ OverrideSpecifier): # " override(some.ident unexpected tokens, ISomeInter..." (14..76) - - (leading_trivia꞉ Whitespace): " " # (14..15) - - (override_keyword꞉ OverrideKeyword): "override" # (15..23) - - (overridden꞉ OverridePathsDeclaration): # "(some.ident unexpected tokens, ISomeInterface, Oth..." (23..76) - - (open_paren꞉ OpenParen): "(" # (23..24) - - (paths꞉ OverridePaths): # "some.ident" (24..34) - - (item꞉ IdentifierPath): # "some.ident" (24..34) - - (item꞉ Identifier): "some" # (24..28) - - (separator꞉ Period): "." # (28..29) - - (item꞉ Identifier): "ident" # (29..34) - - (leading_trivia꞉ Whitespace): " " # (34..35) - - (SKIPPED): "unexpected tokens, ISomeInterface, Other" # (35..75) - - (close_paren꞉ CloseParen): ")" # (75..76) - - (item꞉ FunctionAttribute): # " public" (76..83) - - (leading_trivia꞉ Whitespace): " " # (76..77) - - (variant꞉ PublicKeyword): "public" # (77..83) - - (body꞉ FunctionBody) ► (variant꞉ Block): # " {\n msg.sender.call{do: 1, arg: 1 }();\n msg.send..." (83..309) - - (leading_trivia꞉ Whitespace): " " # (83..84) - - (open_brace꞉ OpenBrace): "{" # (84..85) - - (trailing_trivia꞉ EndOfLine): "\n" # (85..86) - - (statements꞉ Statements): # " msg.sender.call{do: 1, arg: 1 }();\n msg.sender...." (86..306) - - (item꞉ Statement) ► (variant꞉ ExpressionStatement): # " msg.sender.call{do: 1, arg: 1 }();\n" (86..123) - - (expression꞉ Expression) ► (variant꞉ MemberAccessExpression): # " msg.sender.call" (86..103) - - (operand꞉ Expression) ► (variant꞉ MemberAccessExpression): # " msg.sender" (86..98) - - (operand꞉ Expression): # " msg" (86..91) - - (leading_trivia꞉ Whitespace): " " # (86..88) - - (variant꞉ Identifier): "msg" # (88..91) - - (period꞉ Period): "." # (91..92) - - (member꞉ MemberAccess) ► (variant꞉ Identifier): "sender" # (92..98) - - (period꞉ Period): "." # (98..99) - - (member꞉ MemberAccess) ► (variant꞉ Identifier): "call" # (99..103) - - (SKIPPED): "{do: 1, arg: 1 }()" # (103..121) - - (semicolon꞉ Semicolon): ";" # (121..122) - - (trailing_trivia꞉ EndOfLine): "\n" # (122..123) - - (item꞉ Statement) ► (variant꞉ ExpressionStatement): # " msg.sender.call{, empty: 1, parse: 2 }();\n" (123..167) - - (expression꞉ Expression) ► (variant꞉ MemberAccessExpression): # " msg.sender.call" (123..140) - - (operand꞉ Expression) ► (variant꞉ MemberAccessExpression): # " msg.sender" (123..135) - - (operand꞉ Expression): # " msg" (123..128) - - (leading_trivia꞉ Whitespace): " " # (123..125) - - (variant꞉ Identifier): "msg" # (125..128) - - (period꞉ Period): "." # (128..129) - - (member꞉ MemberAccess) ► (variant꞉ Identifier): "sender" # (129..135) - - (period꞉ Period): "." # (135..136) - - (member꞉ MemberAccess) ► (variant꞉ Identifier): "call" # (136..140) - - (SKIPPED): "{, empty: 1, parse: 2 }()" # (140..165) - - (semicolon꞉ Semicolon): ";" # (165..166) - - (trailing_trivia꞉ EndOfLine): "\n" # (166..167) - - (item꞉ Statement) ► (variant꞉ ExpressionStatement): # " msg.sender.call{arg: 1, missing_expr: , no_semic..." (167..230) - - (expression꞉ Expression) ► (variant꞉ MemberAccessExpression): # " msg.sender.call" (167..184) - - (operand꞉ Expression) ► (variant꞉ MemberAccessExpression): # " msg.sender" (167..179) - - (operand꞉ Expression): # " msg" (167..172) - - (leading_trivia꞉ Whitespace): " " # (167..169) - - (variant꞉ Identifier): "msg" # (169..172) - - (period꞉ Period): "." # (172..173) - - (member꞉ MemberAccess) ► (variant꞉ Identifier): "sender" # (173..179) - - (period꞉ Period): "." # (179..180) - - (member꞉ MemberAccess) ► (variant꞉ Identifier): "call" # (180..184) - - (SKIPPED): "{arg: 1, missing_expr: , no_semicolon, , }()" # (184..228) - - (semicolon꞉ Semicolon): ";" # (228..229) - - (trailing_trivia꞉ EndOfLine): "\n" # (229..230) - - (item꞉ Statement) ► (variant꞉ ExpressionStatement): # " msg.sender.call{arg: 1 unexpected tokens, not: 2..." (230..306) - - (expression꞉ Expression) ► (variant꞉ MemberAccessExpression): # " msg.sender.call" (230..247) - - (operand꞉ Expression) ► (variant꞉ MemberAccessExpression): # " msg.sender" (230..242) - - (operand꞉ Expression): # " msg" (230..235) - - (leading_trivia꞉ Whitespace): " " # (230..232) - - (variant꞉ Identifier): "msg" # (232..235) - - (period꞉ Period): "." # (235..236) - - (member꞉ MemberAccess) ► (variant꞉ Identifier): "sender" # (236..242) - - (period꞉ Period): "." # (242..243) - - (member꞉ MemberAccess) ► (variant꞉ Identifier): "call" # (243..247) - - (SKIPPED): "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." # (247..304) - - (semicolon꞉ Semicolon): ";" # (304..305) - - (trailing_trivia꞉ EndOfLine): "\n" # (305..306) - - (leading_trivia꞉ EndOfLine): "\n" # (306..307) - - (close_brace꞉ CloseBrace): "}" # (307..308) - - (trailing_trivia꞉ EndOfLine): "\n" # (308..309) - - (item꞉ ContractMember) ► (variant꞉ FunctionDefinition): # "\nfunction empty() override(some.ident, /* empty */..." (309..388) - - (leading_trivia꞉ EndOfLine): "\n" # (309..310) - - (function_keyword꞉ FunctionKeyword): "function" # (310..318) - - (name꞉ FunctionName): # " empty" (318..324) - - (leading_trivia꞉ Whitespace): " " # (318..319) - - (variant꞉ Identifier): "empty" # (319..324) - - (parameters꞉ ParametersDeclaration): # "()" (324..326) - - (open_paren꞉ OpenParen): "(" # (324..325) - - (parameters꞉ Parameters): [] # (325..325) - - (close_paren꞉ CloseParen): ")" # (325..326) - - (attributes꞉ FunctionAttributes): # " override(some.ident, /* empty */, other.arg.here,..." (326..386) - - (item꞉ FunctionAttribute) ► (variant꞉ OverrideSpecifier): # " override(some.ident, /* empty */, other.arg.here,..." (326..386) - - (leading_trivia꞉ Whitespace): " " # (326..327) - - (override_keyword꞉ OverrideKeyword): "override" # (327..335) - - (overridden꞉ OverridePathsDeclaration): # "(some.ident, /* empty */, other.arg.here, and.here..." (335..386) - - (open_paren꞉ OpenParen): "(" # (335..336) - - (paths꞉ OverridePaths): # "some.ident," (336..347) - - (item꞉ IdentifierPath): # "some.ident" (336..346) - - (item꞉ Identifier): "some" # (336..340) - - (separator꞉ Period): "." # (340..341) - - (item꞉ Identifier): "ident" # (341..346) - - (separator꞉ Comma): "," # (346..347) - - (leading_trivia꞉ Whitespace): " " # (347..348) - - (leading_trivia꞉ MultiLineComment): "/* empty */" # (348..359) - - (SKIPPED): ", other.arg.here, and.here" # (359..385) - - (close_paren꞉ CloseParen): ")" # (385..386) - - (body꞉ FunctionBody): # ";\n" (386..388) - - (variant꞉ Semicolon): ";" # (386..387) - - (trailing_trivia꞉ EndOfLine): "\n" # (387..388) - - (item꞉ ContractMember) ► (variant꞉ FunctionDefinition): # "\nfunction nested_lists() override(some.ident, next..." (388..489) - - (leading_trivia꞉ EndOfLine): "\n" # (388..389) - - (function_keyword꞉ FunctionKeyword): "function" # (389..397) - - (name꞉ FunctionName): # " nested_lists" (397..410) - - (leading_trivia꞉ Whitespace): " " # (397..398) - - (variant꞉ Identifier): "nested_lists" # (398..410) - - (parameters꞉ ParametersDeclaration): # "()" (410..412) - - (open_paren꞉ OpenParen): "(" # (410..411) - - (parameters꞉ Parameters): [] # (411..411) - - (close_paren꞉ CloseParen): ")" # (411..412) - - (attributes꞉ FunctionAttributes): # " override(some.ident, next.do.that, other.while, n..." (412..487) - - (item꞉ FunctionAttribute) ► (variant꞉ OverrideSpecifier): # " override(some.ident, next.do.that, other.while, n..." (412..487) - - (leading_trivia꞉ Whitespace): " " # (412..413) - - (override_keyword꞉ OverrideKeyword): "override" # (413..421) - - (overridden꞉ OverridePathsDeclaration): # "(some.ident, next.do.that, other.while, next.one, ..." (421..487) - - (open_paren꞉ OpenParen): "(" # (421..422) - - (paths꞉ OverridePaths): # "some.ident, next.do.that, other.while, next.one," (422..470) - - (item꞉ IdentifierPath): # "some.ident" (422..432) - - (item꞉ Identifier): "some" # (422..426) - - (separator꞉ Period): "." # (426..427) - - (item꞉ Identifier): "ident" # (427..432) - - (separator꞉ Comma): "," # (432..433) - - (item꞉ IdentifierPath): # " next." (433..439) - - (leading_trivia꞉ Whitespace): " " # (433..434) - - (item꞉ Identifier): "next" # (434..438) - - (separator꞉ Period): "." # (438..439) - - (SKIPPED): "do.that" # (439..446) - - (Comma): "," # (446..447) - - (item꞉ IdentifierPath): # " other." (447..454) - - (leading_trivia꞉ Whitespace): " " # (447..448) - - (item꞉ Identifier): "other" # (448..453) - - (separator꞉ Period): "." # (453..454) - - (SKIPPED): "while" # (454..459) - - (Comma): "," # (459..460) - - (item꞉ IdentifierPath): # " next.one" (460..469) - - (leading_trivia꞉ Whitespace): " " # (460..461) - - (item꞉ Identifier): "next" # (461..465) - - (separator꞉ Period): "." # (465..466) - - (item꞉ Identifier): "one" # (466..469) - - (separator꞉ Comma): "," # (469..470) - - (leading_trivia꞉ Whitespace): " " # (470..471) - - (SKIPPED): "final, ultimate" # (471..486) - - (close_paren꞉ CloseParen): ")" # (486..487) - - (body꞉ FunctionBody): # ";\n" (487..489) - - (variant꞉ Semicolon): ";" # (487..488) - - (trailing_trivia꞉ EndOfLine): "\n" # (488..489) - - (item꞉ ContractMember) ► (variant꞉ FunctionDefinition): # "function nested_lists() override(some., next.arg, ..." (489..560) - - (function_keyword꞉ FunctionKeyword): "function" # (489..497) - - (name꞉ FunctionName): # " nested_lists" (497..510) - - (leading_trivia꞉ Whitespace): " " # (497..498) - - (variant꞉ Identifier): "nested_lists" # (498..510) - - (parameters꞉ ParametersDeclaration): # "()" (510..512) - - (open_paren꞉ OpenParen): "(" # (510..511) - - (parameters꞉ Parameters): [] # (511..511) - - (close_paren꞉ CloseParen): ")" # (511..512) - - (attributes꞉ FunctionAttributes): # " override(some., next.arg, next.one, ultimate)" (512..558) - - (item꞉ FunctionAttribute) ► (variant꞉ OverrideSpecifier): # " override(some., next.arg, next.one, ultimate)" (512..558) - - (leading_trivia꞉ Whitespace): " " # (512..513) - - (override_keyword꞉ OverrideKeyword): "override" # (513..521) - - (overridden꞉ OverridePathsDeclaration): # "(some., next.arg, next.one, ultimate)" (521..558) - - (open_paren꞉ OpenParen): "(" # (521..522) - - (paths꞉ OverridePaths): # "some., next.arg, next.one, ultimate" (522..557) - - (item꞉ IdentifierPath): # "some." (522..527) - - (item꞉ Identifier): "some" # (522..526) - - (separator꞉ Period): "." # (526..527) - - (SKIPPED): "" # (527..527) - - (Comma): "," # (527..528) - - (item꞉ IdentifierPath): # " next.arg" (528..537) - - (leading_trivia꞉ Whitespace): " " # (528..529) - - (item꞉ Identifier): "next" # (529..533) - - (separator꞉ Period): "." # (533..534) - - (item꞉ Identifier): "arg" # (534..537) - - (separator꞉ Comma): "," # (537..538) - - (item꞉ IdentifierPath): # " next.one" (538..547) - - (leading_trivia꞉ Whitespace): " " # (538..539) - - (item꞉ Identifier): "next" # (539..543) - - (separator꞉ Period): "." # (543..544) - - (item꞉ Identifier): "one" # (544..547) - - (separator꞉ Comma): "," # (547..548) - - (item꞉ IdentifierPath): # " ultimate" (548..557) - - (leading_trivia꞉ Whitespace): " " # (548..549) - - (item꞉ Identifier): "ultimate" # (549..557) - - (close_paren꞉ CloseParen): ")" # (557..558) - - (body꞉ FunctionBody): # ";\n" (558..560) - - (variant꞉ Semicolon): ";" # (558..559) - - (trailing_trivia꞉ EndOfLine): "\n" # (559..560) + - (attributes꞉ FunctionAttributes): [] # (14..14) + - (SKIPPED): " override(some.ident unexpected tokens, ISomeInter..." # (14..560) diff --git a/crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/generated/0.6.0-failure.yml new file mode 100644 index 0000000000..8cd98404b2 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/generated/0.6.0-failure.yml @@ -0,0 +1,301 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ function all() override(some.ident unexpected tokens, ISomeInterface, Other) public { │ 0..85 + 2 │ msg.sender.call{do: 1, arg: 1 }(); │ 86..122 + 3 │ msg.sender.call{, empty: 1, parse: 2 }(); │ 123..166 + 4 │ msg.sender.call{arg: 1, missing_expr: , no_semicolon, , }(); │ 167..229 + 5 │ msg.sender.call{arg: 1 unexpected tokens, not: 2, recovered, yet: 3, }(); │ 230..305 + 6 │ │ 306..306 + 7 │ } │ 307..308 + 8 │ │ 309..309 + 9 │ function empty() override(some.ident, /* empty */, other.arg.here, and.here); │ 310..387 + 10 │ │ 388..388 + 11 │ function nested_lists() override(some.ident, next.do.that, other.while, next.one, final, ultimate); │ 389..488 + 12 │ function nested_lists() override(some., next.arg, next.one, ultimate); │ 489..559 + +Errors: # 10 total + - > + Error: Expected CloseParen or Comma. + ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/input.sol:1:36] + │ + 1 │ function all() override(some.ident unexpected tokens, ISomeInterface, Other) public { + │ ────────────────────┬─────────────────── + │ ╰───────────────────── Error occurred here. + ───╯ + - > + Error: Expected Semicolon. + ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/input.sol:2:18] + │ + 2 │ msg.sender.call{do: 1, arg: 1 }(); + │ ─────────┬──────── + │ ╰────────── Error occurred here. + ───╯ + - > + Error: Expected Semicolon. + ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/input.sol:3:18] + │ + 3 │ msg.sender.call{, empty: 1, parse: 2 }(); + │ ────────────┬──────────── + │ ╰────────────── Error occurred here. + ───╯ + - > + Error: Expected Semicolon. + ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/input.sol:4:18] + │ + 4 │ msg.sender.call{arg: 1, missing_expr: , no_semicolon, , }(); + │ ──────────────────────┬───────────────────── + │ ╰─────────────────────── Error occurred here. + ───╯ + - > + Error: Expected Semicolon. + ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/input.sol:5:18] + │ + 5 │ msg.sender.call{arg: 1 unexpected tokens, not: 2, recovered, yet: 3, }(); + │ ────────────────────────────┬──────────────────────────── + │ ╰────────────────────────────── Error occurred here. + ───╯ + - > + Error: Expected Identifier. + ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/input.sol:9:50] + │ + 9 │ function empty() override(some.ident, /* empty */, other.arg.here, and.here); + │ ─────────────┬──────────── + │ ╰────────────── Error occurred here. + ───╯ + - > + Error: Expected Identifier. + ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/input.sol:11:51] + │ + 11 │ function nested_lists() override(some.ident, next.do.that, other.while, next.one, final, ultimate); + │ ───┬─── + │ ╰───── Error occurred here. + ────╯ + - > + Error: Expected Identifier. + ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/input.sol:11:66] + │ + 11 │ function nested_lists() override(some.ident, next.do.that, other.while, next.one, final, ultimate); + │ ──┬── + │ ╰──── Error occurred here. + ────╯ + - > + Error: Expected Identifier. + ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/input.sol:11:83] + │ + 11 │ function nested_lists() override(some.ident, next.do.that, other.while, next.one, final, ultimate); + │ ───────┬─────── + │ ╰───────── Error occurred here. + ────╯ + - > + Error: Expected Identifier. + ╭─[crates/solidity/testing/snapshots/cst_output/ContractMembers/separated_recovery/input.sol:12:39] + │ + 12 │ function nested_lists() override(some., next.arg, next.one, ultimate); + │ │ + │ ╰─ Error occurred here. + ────╯ + +Tree: + - (ContractMembers): # "function all() override(some.ident unexpected toke..." (0..560) + - (item꞉ ContractMember) ► (variant꞉ FunctionDefinition): # "function all() override(some.ident unexpected toke..." (0..309) + - (function_keyword꞉ FunctionKeyword): "function" # (0..8) + - (name꞉ FunctionName): # " all" (8..12) + - (leading_trivia꞉ Whitespace): " " # (8..9) + - (variant꞉ Identifier): "all" # (9..12) + - (parameters꞉ ParametersDeclaration): # "()" (12..14) + - (open_paren꞉ OpenParen): "(" # (12..13) + - (parameters꞉ Parameters): [] # (13..13) + - (close_paren꞉ CloseParen): ")" # (13..14) + - (attributes꞉ FunctionAttributes): # " override(some.ident unexpected tokens, ISomeInter..." (14..83) + - (item꞉ FunctionAttribute) ► (variant꞉ OverrideSpecifier): # " override(some.ident unexpected tokens, ISomeInter..." (14..76) + - (leading_trivia꞉ Whitespace): " " # (14..15) + - (override_keyword꞉ OverrideKeyword): "override" # (15..23) + - (overridden꞉ OverridePathsDeclaration): # "(some.ident unexpected tokens, ISomeInterface, Oth..." (23..76) + - (open_paren꞉ OpenParen): "(" # (23..24) + - (paths꞉ OverridePaths): # "some.ident" (24..34) + - (item꞉ IdentifierPath): # "some.ident" (24..34) + - (item꞉ Identifier): "some" # (24..28) + - (separator꞉ Period): "." # (28..29) + - (item꞉ Identifier): "ident" # (29..34) + - (leading_trivia꞉ Whitespace): " " # (34..35) + - (SKIPPED): "unexpected tokens, ISomeInterface, Other" # (35..75) + - (close_paren꞉ CloseParen): ")" # (75..76) + - (item꞉ FunctionAttribute): # " public" (76..83) + - (leading_trivia꞉ Whitespace): " " # (76..77) + - (variant꞉ PublicKeyword): "public" # (77..83) + - (body꞉ FunctionBody) ► (variant꞉ Block): # " {\n msg.sender.call{do: 1, arg: 1 }();\n msg.send..." (83..309) + - (leading_trivia꞉ Whitespace): " " # (83..84) + - (open_brace꞉ OpenBrace): "{" # (84..85) + - (trailing_trivia꞉ EndOfLine): "\n" # (85..86) + - (statements꞉ Statements): # " msg.sender.call{do: 1, arg: 1 }();\n msg.sender...." (86..306) + - (item꞉ Statement) ► (variant꞉ ExpressionStatement): # " msg.sender.call{do: 1, arg: 1 }();\n" (86..123) + - (expression꞉ Expression) ► (variant꞉ MemberAccessExpression): # " msg.sender.call" (86..103) + - (operand꞉ Expression) ► (variant꞉ MemberAccessExpression): # " msg.sender" (86..98) + - (operand꞉ Expression): # " msg" (86..91) + - (leading_trivia꞉ Whitespace): " " # (86..88) + - (variant꞉ Identifier): "msg" # (88..91) + - (period꞉ Period): "." # (91..92) + - (member꞉ MemberAccess) ► (variant꞉ Identifier): "sender" # (92..98) + - (period꞉ Period): "." # (98..99) + - (member꞉ MemberAccess) ► (variant꞉ Identifier): "call" # (99..103) + - (SKIPPED): "{do: 1, arg: 1 }()" # (103..121) + - (semicolon꞉ Semicolon): ";" # (121..122) + - (trailing_trivia꞉ EndOfLine): "\n" # (122..123) + - (item꞉ Statement) ► (variant꞉ ExpressionStatement): # " msg.sender.call{, empty: 1, parse: 2 }();\n" (123..167) + - (expression꞉ Expression) ► (variant꞉ MemberAccessExpression): # " msg.sender.call" (123..140) + - (operand꞉ Expression) ► (variant꞉ MemberAccessExpression): # " msg.sender" (123..135) + - (operand꞉ Expression): # " msg" (123..128) + - (leading_trivia꞉ Whitespace): " " # (123..125) + - (variant꞉ Identifier): "msg" # (125..128) + - (period꞉ Period): "." # (128..129) + - (member꞉ MemberAccess) ► (variant꞉ Identifier): "sender" # (129..135) + - (period꞉ Period): "." # (135..136) + - (member꞉ MemberAccess) ► (variant꞉ Identifier): "call" # (136..140) + - (SKIPPED): "{, empty: 1, parse: 2 }()" # (140..165) + - (semicolon꞉ Semicolon): ";" # (165..166) + - (trailing_trivia꞉ EndOfLine): "\n" # (166..167) + - (item꞉ Statement) ► (variant꞉ ExpressionStatement): # " msg.sender.call{arg: 1, missing_expr: , no_semic..." (167..230) + - (expression꞉ Expression) ► (variant꞉ MemberAccessExpression): # " msg.sender.call" (167..184) + - (operand꞉ Expression) ► (variant꞉ MemberAccessExpression): # " msg.sender" (167..179) + - (operand꞉ Expression): # " msg" (167..172) + - (leading_trivia꞉ Whitespace): " " # (167..169) + - (variant꞉ Identifier): "msg" # (169..172) + - (period꞉ Period): "." # (172..173) + - (member꞉ MemberAccess) ► (variant꞉ Identifier): "sender" # (173..179) + - (period꞉ Period): "." # (179..180) + - (member꞉ MemberAccess) ► (variant꞉ Identifier): "call" # (180..184) + - (SKIPPED): "{arg: 1, missing_expr: , no_semicolon, , }()" # (184..228) + - (semicolon꞉ Semicolon): ";" # (228..229) + - (trailing_trivia꞉ EndOfLine): "\n" # (229..230) + - (item꞉ Statement) ► (variant꞉ ExpressionStatement): # " msg.sender.call{arg: 1 unexpected tokens, not: 2..." (230..306) + - (expression꞉ Expression) ► (variant꞉ MemberAccessExpression): # " msg.sender.call" (230..247) + - (operand꞉ Expression) ► (variant꞉ MemberAccessExpression): # " msg.sender" (230..242) + - (operand꞉ Expression): # " msg" (230..235) + - (leading_trivia꞉ Whitespace): " " # (230..232) + - (variant꞉ Identifier): "msg" # (232..235) + - (period꞉ Period): "." # (235..236) + - (member꞉ MemberAccess) ► (variant꞉ Identifier): "sender" # (236..242) + - (period꞉ Period): "." # (242..243) + - (member꞉ MemberAccess) ► (variant꞉ Identifier): "call" # (243..247) + - (SKIPPED): "{arg: 1 unexpected tokens, not: 2, recovered, yet:..." # (247..304) + - (semicolon꞉ Semicolon): ";" # (304..305) + - (trailing_trivia꞉ EndOfLine): "\n" # (305..306) + - (leading_trivia꞉ EndOfLine): "\n" # (306..307) + - (close_brace꞉ CloseBrace): "}" # (307..308) + - (trailing_trivia꞉ EndOfLine): "\n" # (308..309) + - (item꞉ ContractMember) ► (variant꞉ FunctionDefinition): # "\nfunction empty() override(some.ident, /* empty */..." (309..388) + - (leading_trivia꞉ EndOfLine): "\n" # (309..310) + - (function_keyword꞉ FunctionKeyword): "function" # (310..318) + - (name꞉ FunctionName): # " empty" (318..324) + - (leading_trivia꞉ Whitespace): " " # (318..319) + - (variant꞉ Identifier): "empty" # (319..324) + - (parameters꞉ ParametersDeclaration): # "()" (324..326) + - (open_paren꞉ OpenParen): "(" # (324..325) + - (parameters꞉ Parameters): [] # (325..325) + - (close_paren꞉ CloseParen): ")" # (325..326) + - (attributes꞉ FunctionAttributes): # " override(some.ident, /* empty */, other.arg.here,..." (326..386) + - (item꞉ FunctionAttribute) ► (variant꞉ OverrideSpecifier): # " override(some.ident, /* empty */, other.arg.here,..." (326..386) + - (leading_trivia꞉ Whitespace): " " # (326..327) + - (override_keyword꞉ OverrideKeyword): "override" # (327..335) + - (overridden꞉ OverridePathsDeclaration): # "(some.ident, /* empty */, other.arg.here, and.here..." (335..386) + - (open_paren꞉ OpenParen): "(" # (335..336) + - (paths꞉ OverridePaths): # "some.ident," (336..347) + - (item꞉ IdentifierPath): # "some.ident" (336..346) + - (item꞉ Identifier): "some" # (336..340) + - (separator꞉ Period): "." # (340..341) + - (item꞉ Identifier): "ident" # (341..346) + - (separator꞉ Comma): "," # (346..347) + - (leading_trivia꞉ Whitespace): " " # (347..348) + - (leading_trivia꞉ MultiLineComment): "/* empty */" # (348..359) + - (SKIPPED): ", other.arg.here, and.here" # (359..385) + - (close_paren꞉ CloseParen): ")" # (385..386) + - (body꞉ FunctionBody): # ";\n" (386..388) + - (variant꞉ Semicolon): ";" # (386..387) + - (trailing_trivia꞉ EndOfLine): "\n" # (387..388) + - (item꞉ ContractMember) ► (variant꞉ FunctionDefinition): # "\nfunction nested_lists() override(some.ident, next..." (388..489) + - (leading_trivia꞉ EndOfLine): "\n" # (388..389) + - (function_keyword꞉ FunctionKeyword): "function" # (389..397) + - (name꞉ FunctionName): # " nested_lists" (397..410) + - (leading_trivia꞉ Whitespace): " " # (397..398) + - (variant꞉ Identifier): "nested_lists" # (398..410) + - (parameters꞉ ParametersDeclaration): # "()" (410..412) + - (open_paren꞉ OpenParen): "(" # (410..411) + - (parameters꞉ Parameters): [] # (411..411) + - (close_paren꞉ CloseParen): ")" # (411..412) + - (attributes꞉ FunctionAttributes): # " override(some.ident, next.do.that, other.while, n..." (412..487) + - (item꞉ FunctionAttribute) ► (variant꞉ OverrideSpecifier): # " override(some.ident, next.do.that, other.while, n..." (412..487) + - (leading_trivia꞉ Whitespace): " " # (412..413) + - (override_keyword꞉ OverrideKeyword): "override" # (413..421) + - (overridden꞉ OverridePathsDeclaration): # "(some.ident, next.do.that, other.while, next.one, ..." (421..487) + - (open_paren꞉ OpenParen): "(" # (421..422) + - (paths꞉ OverridePaths): # "some.ident, next.do.that, other.while, next.one," (422..470) + - (item꞉ IdentifierPath): # "some.ident" (422..432) + - (item꞉ Identifier): "some" # (422..426) + - (separator꞉ Period): "." # (426..427) + - (item꞉ Identifier): "ident" # (427..432) + - (separator꞉ Comma): "," # (432..433) + - (item꞉ IdentifierPath): # " next." (433..439) + - (leading_trivia꞉ Whitespace): " " # (433..434) + - (item꞉ Identifier): "next" # (434..438) + - (separator꞉ Period): "." # (438..439) + - (SKIPPED): "do.that" # (439..446) + - (Comma): "," # (446..447) + - (item꞉ IdentifierPath): # " other." (447..454) + - (leading_trivia꞉ Whitespace): " " # (447..448) + - (item꞉ Identifier): "other" # (448..453) + - (separator꞉ Period): "." # (453..454) + - (SKIPPED): "while" # (454..459) + - (Comma): "," # (459..460) + - (item꞉ IdentifierPath): # " next.one" (460..469) + - (leading_trivia꞉ Whitespace): " " # (460..461) + - (item꞉ Identifier): "next" # (461..465) + - (separator꞉ Period): "." # (465..466) + - (item꞉ Identifier): "one" # (466..469) + - (separator꞉ Comma): "," # (469..470) + - (leading_trivia꞉ Whitespace): " " # (470..471) + - (SKIPPED): "final, ultimate" # (471..486) + - (close_paren꞉ CloseParen): ")" # (486..487) + - (body꞉ FunctionBody): # ";\n" (487..489) + - (variant꞉ Semicolon): ";" # (487..488) + - (trailing_trivia꞉ EndOfLine): "\n" # (488..489) + - (item꞉ ContractMember) ► (variant꞉ FunctionDefinition): # "function nested_lists() override(some., next.arg, ..." (489..560) + - (function_keyword꞉ FunctionKeyword): "function" # (489..497) + - (name꞉ FunctionName): # " nested_lists" (497..510) + - (leading_trivia꞉ Whitespace): " " # (497..498) + - (variant꞉ Identifier): "nested_lists" # (498..510) + - (parameters꞉ ParametersDeclaration): # "()" (510..512) + - (open_paren꞉ OpenParen): "(" # (510..511) + - (parameters꞉ Parameters): [] # (511..511) + - (close_paren꞉ CloseParen): ")" # (511..512) + - (attributes꞉ FunctionAttributes): # " override(some., next.arg, next.one, ultimate)" (512..558) + - (item꞉ FunctionAttribute) ► (variant꞉ OverrideSpecifier): # " override(some., next.arg, next.one, ultimate)" (512..558) + - (leading_trivia꞉ Whitespace): " " # (512..513) + - (override_keyword꞉ OverrideKeyword): "override" # (513..521) + - (overridden꞉ OverridePathsDeclaration): # "(some., next.arg, next.one, ultimate)" (521..558) + - (open_paren꞉ OpenParen): "(" # (521..522) + - (paths꞉ OverridePaths): # "some., next.arg, next.one, ultimate" (522..557) + - (item꞉ IdentifierPath): # "some." (522..527) + - (item꞉ Identifier): "some" # (522..526) + - (separator꞉ Period): "." # (526..527) + - (SKIPPED): "" # (527..527) + - (Comma): "," # (527..528) + - (item꞉ IdentifierPath): # " next.arg" (528..537) + - (leading_trivia꞉ Whitespace): " " # (528..529) + - (item꞉ Identifier): "next" # (529..533) + - (separator꞉ Period): "." # (533..534) + - (item꞉ Identifier): "arg" # (534..537) + - (separator꞉ Comma): "," # (537..538) + - (item꞉ IdentifierPath): # " next.one" (538..547) + - (leading_trivia꞉ Whitespace): " " # (538..539) + - (item꞉ Identifier): "next" # (539..543) + - (separator꞉ Period): "." # (543..544) + - (item꞉ Identifier): "one" # (544..547) + - (separator꞉ Comma): "," # (547..548) + - (item꞉ IdentifierPath): # " ultimate" (548..557) + - (leading_trivia꞉ Whitespace): " " # (548..549) + - (item꞉ Identifier): "ultimate" # (549..557) + - (close_paren꞉ CloseParen): ")" # (557..558) + - (body꞉ FunctionBody): # ";\n" (558..560) + - (variant꞉ Semicolon): ";" # (558..559) + - (trailing_trivia꞉ EndOfLine): "\n" # (559..560) diff --git a/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/overridden/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/overridden/generated/0.5.0-failure.yml new file mode 100644 index 0000000000..7269df9fad --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/overridden/generated/0.5.0-failure.yml @@ -0,0 +1,37 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ function some() public virtual override returns (uint256) { │ 0..59 + 2 │ return 1; │ 60..70 + 3 │ } │ 71..72 + +Errors: # 1 total + - > + Error: Expected OpenBrace or ReturnsKeyword or Semicolon. + ╭─[crates/solidity/testing/snapshots/cst_output/FunctionDefinition/overridden/input.sol:1:31] + │ + 1 │ ╭─▶ function some() public virtual override returns (uint256) { + ┆ ┆ + 3 │ ├─▶ } + │ │ + │ ╰─────── Error occurred here. + ───╯ + +Tree: + - (FunctionDefinition): # "function some() public virtual override returns (u..." (0..73) + - (function_keyword꞉ FunctionKeyword): "function" # (0..8) + - (name꞉ FunctionName): # " some" (8..13) + - (leading_trivia꞉ Whitespace): " " # (8..9) + - (variant꞉ Identifier): "some" # (9..13) + - (parameters꞉ ParametersDeclaration): # "()" (13..15) + - (open_paren꞉ OpenParen): "(" # (13..14) + - (parameters꞉ Parameters): [] # (14..14) + - (close_paren꞉ CloseParen): ")" # (14..15) + - (attributes꞉ FunctionAttributes): # " public virtual" (15..30) + - (item꞉ FunctionAttribute): # " public" (15..22) + - (leading_trivia꞉ Whitespace): " " # (15..16) + - (variant꞉ PublicKeyword): "public" # (16..22) + - (item꞉ FunctionAttribute) ► (variant꞉ ModifierInvocation) ► (name꞉ IdentifierPath): # " virtual" (22..30) + - (leading_trivia꞉ Whitespace): " " # (22..23) + - (item꞉ Identifier): "virtual" # (23..30) + - (SKIPPED): " override returns (uint256) {\n\treturn 1;\n}\n" # (30..73) 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 deleted file mode 100644 index 9d69d12a84..0000000000 --- a/crates/solidity/testing/snapshots/cst_output/FunctionDefinition/overridden/generated/0.5.0-success.yml +++ /dev/null @@ -1,53 +0,0 @@ -# This file is generated automatically by infrastructure scripts. Please don't edit by hand. - -Source: > - 1 │ function some() public virtual override returns (uint256) { │ 0..59 - 2 │ return 1; │ 60..70 - 3 │ } │ 71..72 - -Errors: [] - -Tree: - - (FunctionDefinition): # "function some() public virtual override returns (u..." (0..73) - - (function_keyword꞉ FunctionKeyword): "function" # (0..8) - - (name꞉ FunctionName): # " some" (8..13) - - (leading_trivia꞉ Whitespace): " " # (8..9) - - (variant꞉ Identifier): "some" # (9..13) - - (parameters꞉ ParametersDeclaration): # "()" (13..15) - - (open_paren꞉ OpenParen): "(" # (13..14) - - (parameters꞉ Parameters): [] # (14..14) - - (close_paren꞉ CloseParen): ")" # (14..15) - - (attributes꞉ FunctionAttributes): # " public virtual override" (15..39) - - (item꞉ FunctionAttribute): # " public" (15..22) - - (leading_trivia꞉ Whitespace): " " # (15..16) - - (variant꞉ PublicKeyword): "public" # (16..22) - - (item꞉ FunctionAttribute) ► (variant꞉ ModifierInvocation) ► (name꞉ IdentifierPath): # " virtual" (22..30) - - (leading_trivia꞉ Whitespace): " " # (22..23) - - (item꞉ Identifier): "virtual" # (23..30) - - (item꞉ FunctionAttribute) ► (variant꞉ OverrideSpecifier): # " override" (30..39) - - (leading_trivia꞉ Whitespace): " " # (30..31) - - (override_keyword꞉ OverrideKeyword): "override" # (31..39) - - (returns꞉ ReturnsDeclaration): # " returns (uint256)" (39..57) - - (leading_trivia꞉ Whitespace): " " # (39..40) - - (returns_keyword꞉ ReturnsKeyword): "returns" # (40..47) - - (variables꞉ ParametersDeclaration): # " (uint256)" (47..57) - - (leading_trivia꞉ Whitespace): " " # (47..48) - - (open_paren꞉ OpenParen): "(" # (48..49) - - (parameters꞉ Parameters): # "uint256" (49..56) - - (item꞉ Parameter) ► (type_name꞉ TypeName) ► (variant꞉ ElementaryType) ► (variant꞉ UintKeyword): "uint256" # (49..56) - - (close_paren꞉ CloseParen): ")" # (56..57) - - (body꞉ FunctionBody) ► (variant꞉ Block): # " {\n\treturn 1;\n}\n" (57..73) - - (leading_trivia꞉ Whitespace): " " # (57..58) - - (open_brace꞉ OpenBrace): "{" # (58..59) - - (trailing_trivia꞉ EndOfLine): "\n" # (59..60) - - (statements꞉ Statements): # "\treturn 1;\n" (60..71) - - (item꞉ Statement) ► (variant꞉ ReturnStatement): # "\treturn 1;\n" (60..71) - - (leading_trivia꞉ Whitespace): "\t" # (60..61) - - (return_keyword꞉ ReturnKeyword): "return" # (61..67) - - (expression꞉ Expression) ► (variant꞉ DecimalNumberExpression): # " 1" (67..69) - - (leading_trivia꞉ Whitespace): " " # (67..68) - - (literal꞉ DecimalLiteral): "1" # (68..69) - - (semicolon꞉ Semicolon): ";" # (69..70) - - (trailing_trivia꞉ EndOfLine): "\n" # (70..71) - - (close_brace꞉ CloseBrace): "}" # (71..72) - - (trailing_trivia꞉ EndOfLine): "\n" # (72..73) diff --git a/crates/solidity/testing/snapshots/cst_output/ModifierDefinition/override_attr/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/ModifierDefinition/override_attr/generated/0.4.11-failure.yml new file mode 100644 index 0000000000..7982751be2 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ModifierDefinition/override_attr/generated/0.4.11-failure.yml @@ -0,0 +1,30 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ modifier mod(uint a) override { _; } │ 0..36 + +Errors: # 1 total + - > + Error: Expected OpenBrace or Semicolon. + ╭─[crates/solidity/testing/snapshots/cst_output/ModifierDefinition/override_attr/input.sol:1:21] + │ + 1 │ modifier mod(uint a) override { _; } + │ ────────┬──────── + │ ╰────────── Error occurred here. + ───╯ + +Tree: + - (ModifierDefinition): # "modifier mod(uint a) override { _; }\n" (0..37) + - (modifier_keyword꞉ ModifierKeyword): "modifier" # (0..8) + - (leading_trivia꞉ Whitespace): " " # (8..9) + - (name꞉ Identifier): "mod" # (9..12) + - (parameters꞉ ParametersDeclaration): # "(uint a)" (12..20) + - (open_paren꞉ OpenParen): "(" # (12..13) + - (parameters꞉ Parameters): # "uint a" (13..19) + - (item꞉ Parameter): # "uint a" (13..19) + - (type_name꞉ TypeName) ► (variant꞉ ElementaryType) ► (variant꞉ UintKeyword): "uint" # (13..17) + - (leading_trivia꞉ Whitespace): " " # (17..18) + - (name꞉ Identifier): "a" # (18..19) + - (close_paren꞉ CloseParen): ")" # (19..20) + - (attributes꞉ ModifierAttributes): [] # (20..20) + - (SKIPPED): " override { _; }\n" # (20..37) diff --git a/crates/solidity/testing/snapshots/cst_output/ModifierDefinition/override_attr/generated/0.6.0-success.yml b/crates/solidity/testing/snapshots/cst_output/ModifierDefinition/override_attr/generated/0.6.0-success.yml new file mode 100644 index 0000000000..488a7e6e40 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ModifierDefinition/override_attr/generated/0.6.0-success.yml @@ -0,0 +1,36 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ modifier mod(uint a) override { _; } │ 0..36 + +Errors: [] + +Tree: + - (ModifierDefinition): # "modifier mod(uint a) override { _; }\n" (0..37) + - (modifier_keyword꞉ ModifierKeyword): "modifier" # (0..8) + - (leading_trivia꞉ Whitespace): " " # (8..9) + - (name꞉ Identifier): "mod" # (9..12) + - (parameters꞉ ParametersDeclaration): # "(uint a)" (12..20) + - (open_paren꞉ OpenParen): "(" # (12..13) + - (parameters꞉ Parameters): # "uint a" (13..19) + - (item꞉ Parameter): # "uint a" (13..19) + - (type_name꞉ TypeName) ► (variant꞉ ElementaryType) ► (variant꞉ UintKeyword): "uint" # (13..17) + - (leading_trivia꞉ Whitespace): " " # (17..18) + - (name꞉ Identifier): "a" # (18..19) + - (close_paren꞉ CloseParen): ")" # (19..20) + - (attributes꞉ ModifierAttributes): # " override" (20..29) + - (item꞉ ModifierAttribute) ► (variant꞉ OverrideSpecifier): # " override" (20..29) + - (leading_trivia꞉ Whitespace): " " # (20..21) + - (override_keyword꞉ OverrideKeyword): "override" # (21..29) + - (body꞉ FunctionBody) ► (variant꞉ Block): # " { _; }\n" (29..37) + - (leading_trivia꞉ Whitespace): " " # (29..30) + - (open_brace꞉ OpenBrace): "{" # (30..31) + - (statements꞉ Statements): # " _;" (31..34) + - (item꞉ Statement) ► (variant꞉ ExpressionStatement): # " _;" (31..34) + - (expression꞉ Expression): # " _" (31..33) + - (leading_trivia꞉ Whitespace): " " # (31..32) + - (variant꞉ Identifier): "_" # (32..33) + - (semicolon꞉ Semicolon): ";" # (33..34) + - (leading_trivia꞉ Whitespace): " " # (34..35) + - (close_brace꞉ CloseBrace): "}" # (35..36) + - (trailing_trivia꞉ EndOfLine): "\n" # (36..37) diff --git a/crates/solidity/testing/snapshots/cst_output/ModifierDefinition/override_attr/input.sol b/crates/solidity/testing/snapshots/cst_output/ModifierDefinition/override_attr/input.sol new file mode 100644 index 0000000000..f7e0b47dff --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ModifierDefinition/override_attr/input.sol @@ -0,0 +1 @@ +modifier mod(uint a) override { _; } diff --git a/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/constant_attribute/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/constant_attribute/generated/0.5.0-failure.yml index 9dfbec4ea9..5321ba0ed1 100644 --- a/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/constant_attribute/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/constant_attribute/generated/0.5.0-failure.yml @@ -6,7 +6,7 @@ Source: > Errors: # 1 total - > - Error: Expected ExternalKeyword or Identifier or OpenBrace or OverrideKeyword or PayableKeyword or PureKeyword or Semicolon or ViewKeyword. + Error: Expected ExternalKeyword or Identifier or OpenBrace or PayableKeyword or PureKeyword or Semicolon or ViewKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/constant_attribute/input.sol:2:12] │ 2 │ function () constant {} diff --git a/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/internal_attribute/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/internal_attribute/generated/0.5.0-failure.yml index b0609346aa..fdbc5f45e2 100644 --- a/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/internal_attribute/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/internal_attribute/generated/0.5.0-failure.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected ExternalKeyword or Identifier or OpenBrace or OverrideKeyword or PayableKeyword or PureKeyword or Semicolon or ViewKeyword. + Error: Expected ExternalKeyword or Identifier or OpenBrace or PayableKeyword or PureKeyword or Semicolon or ViewKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/internal_attribute/input.sol:1:12] │ 1 │ function () internal {} diff --git a/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/private_attribute/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/private_attribute/generated/0.5.0-failure.yml index a3639b3265..528b3becad 100644 --- a/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/private_attribute/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/private_attribute/generated/0.5.0-failure.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected ExternalKeyword or Identifier or OpenBrace or OverrideKeyword or PayableKeyword or PureKeyword or Semicolon or ViewKeyword. + Error: Expected ExternalKeyword or Identifier or OpenBrace or PayableKeyword or PureKeyword or Semicolon or ViewKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/private_attribute/input.sol:1:12] │ 1 │ function () private {} diff --git a/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/public_attribute/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/public_attribute/generated/0.5.0-failure.yml index 6b00510ec7..3e2d05c503 100644 --- a/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/public_attribute/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/public_attribute/generated/0.5.0-failure.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected ExternalKeyword or Identifier or OpenBrace or OverrideKeyword or PayableKeyword or PureKeyword or Semicolon or ViewKeyword. + Error: Expected ExternalKeyword or Identifier or OpenBrace or PayableKeyword or PureKeyword or Semicolon or ViewKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/UnnamedFunctionDefinition/public_attribute/input.sol:1:12] │ 1 │ function () public {}