From f659ac090e96860ac8f949b0229a66d1ca68c73a Mon Sep 17 00:00:00 2001 From: OmarTawfik <15987992+OmarTawfik@users.noreply.github.com> Date: Mon, 12 Feb 2024 07:10:47 -0800 Subject: [PATCH] prevent parsing multiple literals under `StringExpression` before `0.5.14` --- .changeset/four-cats-bake.md | 5 + .../inputs/language/src/definition.rs | 27 +++- .../cargo/crate/src/generated/language.rs | 64 +++++--- .../generated/napi_interface/ast_selectors.rs | 3 +- .../tests/src/cst_output/generated/mod.rs | 3 +- .../package/src/ast/generated/ast_types.ts | 34 ++-- .../outputs/spec/generated/grammar.ebnf | 8 +- .../public/05-expressions/05-strings.md | 6 +- .../generated/public/supported-versions.md | 4 +- .../multiple/generated/0.4.11-failure.yml | 17 ++ ...{0.4.11-success.yml => 0.5.14-success.yml} | 0 .../single/generated/0.4.11-failure.yml | 17 ++ ...{0.4.11-success.yml => 0.5.14-success.yml} | 0 .../generated/0.4.11-failure.yml | 12 +- .../generated/0.5.14-failure.yml | 19 +++ .../generated/0.4.11-failure.yml | 8 +- .../generated/0.5.14-failure.yml | 145 ++++++++++++++++++ .../generated/0.4.11-failure.yml | 17 ++ ...{0.4.11-success.yml => 0.5.14-success.yml} | 0 .../generated/0.4.11-failure.yml | 2 +- .../generated/0.5.14-failure.yml | 17 ++ .../generated/0.4.11-failure.yml | 2 +- .../generated/0.5.14-failure.yml | 17 ++ .../generated/0.4.11-failure.yml | 2 +- .../generated/0.5.14-failure.yml | 17 ++ .../generated/0.4.11-failure.yml | 2 +- .../generated/0.5.14-failure.yml | 17 ++ .../multiple/generated/0.4.11-failure.yml | 17 ++ ...{0.4.11-success.yml => 0.5.14-success.yml} | 0 .../generated/0.4.11-failure.yml | 17 ++ ...{0.4.11-success.yml => 0.5.14-success.yml} | 0 .../single/generated/0.4.11-failure.yml | 17 ++ ...{0.4.11-success.yml => 0.5.14-success.yml} | 0 .../generated/0.4.11-failure.yml | 12 +- .../generated/0.5.14-failure.yml | 19 +++ .../generated/0.4.11-failure.yml | 17 ++ ...{0.4.11-success.yml => 0.5.14-success.yml} | 0 37 files changed, 497 insertions(+), 67 deletions(-) create mode 100644 .changeset/four-cats-bake.md create mode 100644 crates/solidity/testing/snapshots/cst_output/AsciiStringLiterals/multiple/generated/0.4.11-failure.yml rename crates/solidity/testing/snapshots/cst_output/AsciiStringLiterals/multiple/generated/{0.4.11-success.yml => 0.5.14-success.yml} (100%) create mode 100644 crates/solidity/testing/snapshots/cst_output/AsciiStringLiterals/single/generated/0.4.11-failure.yml rename crates/solidity/testing/snapshots/cst_output/AsciiStringLiterals/single/generated/{0.4.11-success.yml => 0.5.14-success.yml} (100%) create mode 100644 crates/solidity/testing/snapshots/cst_output/AsciiStringLiterals/single_trailing_ident/generated/0.5.14-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/ContractDefinition/function_multiple_delimiters/generated/0.5.14-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/HexStringLiterals/all_separated_pairs/generated/0.4.11-failure.yml rename crates/solidity/testing/snapshots/cst_output/HexStringLiterals/all_separated_pairs/generated/{0.4.11-success.yml => 0.5.14-success.yml} (100%) create mode 100644 crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_consecutive_separators/generated/0.5.14-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_leading_separator/generated/0.5.14-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_separator_after_single_char/generated/0.5.14-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_trailing_separator/generated/0.5.14-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/HexStringLiterals/multiple/generated/0.4.11-failure.yml rename crates/solidity/testing/snapshots/cst_output/HexStringLiterals/multiple/generated/{0.4.11-success.yml => 0.5.14-success.yml} (100%) create mode 100644 crates/solidity/testing/snapshots/cst_output/HexStringLiterals/no_separators/generated/0.4.11-failure.yml rename crates/solidity/testing/snapshots/cst_output/HexStringLiterals/no_separators/generated/{0.4.11-success.yml => 0.5.14-success.yml} (100%) create mode 100644 crates/solidity/testing/snapshots/cst_output/HexStringLiterals/single/generated/0.4.11-failure.yml rename crates/solidity/testing/snapshots/cst_output/HexStringLiterals/single/generated/{0.4.11-success.yml => 0.5.14-success.yml} (100%) create mode 100644 crates/solidity/testing/snapshots/cst_output/HexStringLiterals/single_trailing_ident/generated/0.5.14-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/HexStringLiterals/some_separated_pairs/generated/0.4.11-failure.yml rename crates/solidity/testing/snapshots/cst_output/HexStringLiterals/some_separated_pairs/generated/{0.4.11-success.yml => 0.5.14-success.yml} (100%) diff --git a/.changeset/four-cats-bake.md b/.changeset/four-cats-bake.md new file mode 100644 index 0000000000..afdb0335c2 --- /dev/null +++ b/.changeset/four-cats-bake.md @@ -0,0 +1,5 @@ +--- +"@nomicfoundation/slang": patch +--- + +prevent parsing multiple literals under `StringExpression` before `0.5.14` diff --git a/crates/solidity/inputs/language/src/definition.rs b/crates/solidity/inputs/language/src/definition.rs index 200e60f54f..a528796cfa 100644 --- a/crates/solidity/inputs/language/src/definition.rs +++ b/crates/solidity/inputs/language/src/definition.rs @@ -3688,15 +3688,30 @@ codegen_language_macros::compile!(Language( Enum( name = StringExpression, variants = [ - EnumVariant(reference = HexStringLiterals), - EnumVariant(reference = AsciiStringLiterals), + EnumVariant(reference = HexStringLiteral, enabled = Till("0.5.14")), + EnumVariant( + reference = HexStringLiterals, + enabled = From("0.5.14") + ), + EnumVariant( + reference = AsciiStringLiteral, + enabled = Till("0.5.14") + ), + EnumVariant( + reference = AsciiStringLiterals, + enabled = From("0.5.14") + ), EnumVariant( reference = UnicodeStringLiterals, enabled = From("0.7.0") ) ] ), - Repeated(name = HexStringLiterals, reference = HexStringLiteral), + Repeated( + name = HexStringLiterals, + reference = HexStringLiteral, + enabled = From("0.5.14") + ), Token( name = HexStringLiteral, definitions = [ @@ -3740,7 +3755,11 @@ codegen_language_macros::compile!(Language( Range(inclusive_start = 'A', inclusive_end = 'F') ]) ), - Repeated(name = AsciiStringLiterals, reference = AsciiStringLiteral), + Repeated( + name = AsciiStringLiterals, + reference = AsciiStringLiteral, + enabled = From("0.5.14") + ), Token( name = AsciiStringLiteral, definitions = [ diff --git a/crates/solidity/outputs/cargo/crate/src/generated/language.rs b/crates/solidity/outputs/cargo/crate/src/generated/language.rs index 9c75e0222b..cfd0b2febb 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/language.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/language.rs @@ -38,6 +38,7 @@ pub struct Language { pub(crate) version_is_at_least_0_5_3: bool, pub(crate) version_is_at_least_0_5_10: bool, pub(crate) version_is_at_least_0_5_12: bool, + pub(crate) version_is_at_least_0_5_14: bool, pub(crate) version_is_at_least_0_6_0: bool, pub(crate) version_is_at_least_0_6_2: bool, pub(crate) version_is_at_least_0_6_5: bool, @@ -165,6 +166,7 @@ impl Language { version_is_at_least_0_5_3: Version::new(0, 5, 3) <= version, version_is_at_least_0_5_10: Version::new(0, 5, 10) <= version, version_is_at_least_0_5_12: Version::new(0, 5, 12) <= version, + version_is_at_least_0_5_14: Version::new(0, 5, 14) <= version, version_is_at_least_0_6_0: Version::new(0, 6, 0) <= version, version_is_at_least_0_6_2: Version::new(0, 6, 2) <= version, version_is_at_least_0_6_5: Version::new(0, 6, 5) <= version, @@ -372,13 +374,17 @@ impl Language { #[allow(unused_assignments, unused_parens)] fn ascii_string_literals(&self, input: &mut ParserContext<'_>) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - self.parse_token_with_trivia::( - input, - TokenKind::AsciiStringLiteral, - ) - .with_name(FieldName::Item) - }) + if self.version_is_at_least_0_5_14 { + OneOrMoreHelper::run(input, |input| { + self.parse_token_with_trivia::( + input, + TokenKind::AsciiStringLiteral, + ) + .with_name(FieldName::Item) + }) + } else { + ParserResult::disabled() + } .with_kind(RuleKind::AsciiStringLiterals) } @@ -2745,13 +2751,17 @@ impl Language { #[allow(unused_assignments, unused_parens)] fn hex_string_literals(&self, input: &mut ParserContext<'_>) -> ParserResult { - OneOrMoreHelper::run(input, |input| { - self.parse_token_with_trivia::( - input, - TokenKind::HexStringLiteral, - ) - .with_name(FieldName::Item) - }) + if self.version_is_at_least_0_5_14 { + OneOrMoreHelper::run(input, |input| { + self.parse_token_with_trivia::( + input, + TokenKind::HexStringLiteral, + ) + .with_name(FieldName::Item) + }) + } else { + ParserResult::disabled() + } .with_kind(RuleKind::HexStringLiterals) } @@ -4459,10 +4469,28 @@ impl Language { #[allow(unused_assignments, unused_parens)] 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_5_14 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::HexStringLiteral, + ); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_5_14 { + let result = self.hex_string_literals(input); + choice.consider(input, result)?; + } + if !self.version_is_at_least_0_5_14 { + let result = self.parse_token_with_trivia::( + input, + TokenKind::AsciiStringLiteral, + ); + choice.consider(input, result)?; + } + if self.version_is_at_least_0_5_14 { + 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)?; diff --git a/crates/solidity/outputs/cargo/crate/src/generated/napi_interface/ast_selectors.rs b/crates/solidity/outputs/cargo/crate/src/generated/napi_interface/ast_selectors.rs index 6303ea18c2..a9a65a441e 100644 --- a/crates/solidity/outputs/cargo/crate/src/generated/napi_interface/ast_selectors.rs +++ b/crates/solidity/outputs/cargo/crate/src/generated/napi_interface/ast_selectors.rs @@ -2002,7 +2002,8 @@ impl Selector { RuleKind::HexStringLiterals, RuleKind::AsciiStringLiterals, RuleKind::UnicodeStringLiterals, - ]) + ]) || node + .is_token_with_kinds(&[TokenKind::HexStringLiteral, TokenKind::AsciiStringLiteral]) }) } } 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 b1fda13211..e7fbd3d2f5 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 @@ -104,7 +104,7 @@ mod YulLeaveStatement; #[allow(non_snake_case)] mod YulVariableDeclarationStatement; -pub const VERSION_BREAKS: [Version; 25] = [ +pub const VERSION_BREAKS: [Version; 26] = [ Version::new(0, 4, 11), Version::new(0, 4, 12), Version::new(0, 4, 14), @@ -114,6 +114,7 @@ pub const VERSION_BREAKS: [Version; 25] = [ Version::new(0, 5, 3), Version::new(0, 5, 10), Version::new(0, 5, 12), + Version::new(0, 5, 14), Version::new(0, 6, 0), Version::new(0, 6, 2), Version::new(0, 6, 5), 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 38b39e8ce7..27dff45069 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 @@ -4882,27 +4882,33 @@ export class NumberUnit { } export class StringExpression { - private readonly fetch: () => HexStringLiterals | AsciiStringLiterals | UnicodeStringLiterals = once(() => { - const variant = ast_internal.selectChoice(this.cst); + private readonly fetch: () => HexStringLiterals | AsciiStringLiterals | UnicodeStringLiterals | TokenNode = once( + () => { + const variant = ast_internal.selectChoice(this.cst); - switch (variant.kind) { - case RuleKind.HexStringLiterals: - return new HexStringLiterals(variant as RuleNode); - case RuleKind.AsciiStringLiterals: - return new AsciiStringLiterals(variant as RuleNode); - case RuleKind.UnicodeStringLiterals: - return new UnicodeStringLiterals(variant as RuleNode); + switch (variant.kind) { + case RuleKind.HexStringLiterals: + return new HexStringLiterals(variant as RuleNode); + case RuleKind.AsciiStringLiterals: + return new AsciiStringLiterals(variant as RuleNode); + case RuleKind.UnicodeStringLiterals: + return new UnicodeStringLiterals(variant as RuleNode); - default: - assert.fail(`Unexpected variant: ${variant.kind}`); - } - }); + case TokenKind.HexStringLiteral: + case TokenKind.AsciiStringLiteral: + return variant as TokenNode; + + default: + assert.fail(`Unexpected variant: ${variant.kind}`); + } + }, + ); public constructor(public readonly cst: RuleNode) { assertKind(this.cst.kind, RuleKind.StringExpression); } - public get variant(): HexStringLiterals | AsciiStringLiterals | UnicodeStringLiterals { + public get variant(): HexStringLiterals | AsciiStringLiterals | UnicodeStringLiterals | TokenNode { return this.fetch(); } } diff --git a/crates/solidity/outputs/spec/generated/grammar.ebnf b/crates/solidity/outputs/spec/generated/grammar.ebnf index 82730ca40a..83c39d450f 100644 --- a/crates/solidity/outputs/spec/generated/grammar.ebnf +++ b/crates/solidity/outputs/spec/generated/grammar.ebnf @@ -1232,10 +1232,13 @@ NumberUnit = WEI_KEYWORD (* 5.5. Strings: *) -StringExpression = HexStringLiterals - | AsciiStringLiterals +StringExpression = HEX_STRING_LITERAL (* Deprecated in 0.5.14 *) + | HexStringLiterals (* Introduced in 0.5.14 *) + | ASCII_STRING_LITERAL (* Deprecated in 0.5.14 *) + | AsciiStringLiterals (* Introduced in 0.5.14 *) | UnicodeStringLiterals; (* Introduced in 0.7.0 *) +(* Introduced in 0.5.14 *) HexStringLiterals = HEX_STRING_LITERAL+; HEX_STRING_LITERAL = «SINGLE_QUOTED_HEX_STRING_LITERAL»; @@ -1250,6 +1253,7 @@ HEX_STRING_LITERAL = «DOUBLE_QUOTED_HEX_STRING_LITERAL»; «HEX_CHARACTER» = ("0"…"9") | ("a"…"f") | ("A"…"F"); +(* Introduced in 0.5.14 *) AsciiStringLiterals = ASCII_STRING_LITERAL+; ASCII_STRING_LITERAL = «SINGLE_QUOTED_ASCII_STRING_LITERAL»; diff --git a/crates/solidity/outputs/spec/generated/public/05-expressions/05-strings.md b/crates/solidity/outputs/spec/generated/public/05-expressions/05-strings.md index 273d546d06..9cbb2abaec 100644 --- a/crates/solidity/outputs/spec/generated/public/05-expressions/05-strings.md +++ b/crates/solidity/outputs/spec/generated/public/05-expressions/05-strings.md @@ -8,13 +8,13 @@ ``` -
StringExpression = HexStringLiterals
| AsciiStringLiterals
| UnicodeStringLiterals; (* Introduced in 0.7.0 *)
+
StringExpression = HEX_STRING_LITERAL (* Deprecated in 0.5.14 *)
| HexStringLiterals (* Introduced in 0.5.14 *)
| ASCII_STRING_LITERAL (* Deprecated in 0.5.14 *)
| AsciiStringLiterals (* Introduced in 0.5.14 *)
| UnicodeStringLiterals; (* Introduced in 0.7.0 *)
```{ .ebnf #HexStringLiterals } ``` -
HexStringLiterals = HEX_STRING_LITERAL+;
+
(* Introduced in 0.5.14 *)
HexStringLiterals = HEX_STRING_LITERAL+;
```{ .ebnf #HexStringLiteral } @@ -50,7 +50,7 @@ ``` -
AsciiStringLiterals = ASCII_STRING_LITERAL+;
+
(* Introduced in 0.5.14 *)
AsciiStringLiterals = ASCII_STRING_LITERAL+;
```{ .ebnf #AsciiStringLiteral } diff --git a/crates/solidity/outputs/spec/generated/public/supported-versions.md b/crates/solidity/outputs/spec/generated/public/supported-versions.md index 0a915339c4..fa572e34f5 100644 --- a/crates/solidity/outputs/spec/generated/public/supported-versions.md +++ b/crates/solidity/outputs/spec/generated/public/supported-versions.md @@ -4,6 +4,6 @@ This specification compiles information from 77 publicly released versions of So `0.4.11` `0.4.12` `0.4.13` `0.4.14` `0.4.15` `0.4.16` `0.4.17` `0.4.18` `0.4.19` `0.4.20` `0.4.21` `0.4.22` `0.4.23` `0.4.24` `0.4.25` `0.4.26` `0.5.0` `0.5.1` `0.5.2` `0.5.3` `0.5.4` `0.5.5` `0.5.6` `0.5.7` `0.5.8` `0.5.9` `0.5.10` `0.5.11` `0.5.12` `0.5.13` `0.5.14` `0.5.15` `0.5.16` `0.5.17` `0.6.0` `0.6.1` `0.6.2` `0.6.3` `0.6.4` `0.6.5` `0.6.6` `0.6.7` `0.6.8` `0.6.9` `0.6.10` `0.6.11` `0.6.12` `0.7.0` `0.7.1` `0.7.2` `0.7.3` `0.7.4` `0.7.5` `0.7.6` `0.8.0` `0.8.1` `0.8.2` `0.8.3` `0.8.4` `0.8.5` `0.8.6` `0.8.7` `0.8.8` `0.8.9` `0.8.10` `0.8.11` `0.8.12` `0.8.13` `0.8.14` `0.8.15` `0.8.16` `0.8.17` `0.8.18` `0.8.19` `0.8.20` `0.8.21` `0.8.22` -Among which, 25 versions have breaking changes: +Among which, 26 versions have breaking changes: -`0.4.11` `0.4.12` `0.4.14` `0.4.21` `0.4.22` `0.5.0` `0.5.3` `0.5.10` `0.5.12` `0.6.0` `0.6.2` `0.6.5` `0.6.8` `0.6.11` `0.7.0` `0.7.1` `0.7.4` `0.8.0` `0.8.4` `0.8.7` `0.8.8` `0.8.13` `0.8.18` `0.8.19` `0.8.22` +`0.4.11` `0.4.12` `0.4.14` `0.4.21` `0.4.22` `0.5.0` `0.5.3` `0.5.10` `0.5.12` `0.5.14` `0.6.0` `0.6.2` `0.6.5` `0.6.8` `0.6.11` `0.7.0` `0.7.1` `0.7.4` `0.8.0` `0.8.4` `0.8.7` `0.8.8` `0.8.13` `0.8.18` `0.8.19` `0.8.22` diff --git a/crates/solidity/testing/snapshots/cst_output/AsciiStringLiterals/multiple/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/AsciiStringLiterals/multiple/generated/0.4.11-failure.yml new file mode 100644 index 0000000000..047093b4c6 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/AsciiStringLiterals/multiple/generated/0.4.11-failure.yml @@ -0,0 +1,17 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ "foo" 'bar' │ 0..11 + +Errors: # 1 total + - > + Error: Expected end of file. + ╭─[crates/solidity/testing/snapshots/cst_output/AsciiStringLiterals/multiple/input.sol:1:1] + │ + 1 │ "foo" 'bar' + │ ─────┬───── + │ ╰─────── Error occurred here. + ───╯ + +Tree: + - (SKIPPED): '"foo" ''bar''' # (0..11) diff --git a/crates/solidity/testing/snapshots/cst_output/AsciiStringLiterals/multiple/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/AsciiStringLiterals/multiple/generated/0.5.14-success.yml similarity index 100% rename from crates/solidity/testing/snapshots/cst_output/AsciiStringLiterals/multiple/generated/0.4.11-success.yml rename to crates/solidity/testing/snapshots/cst_output/AsciiStringLiterals/multiple/generated/0.5.14-success.yml diff --git a/crates/solidity/testing/snapshots/cst_output/AsciiStringLiterals/single/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/AsciiStringLiterals/single/generated/0.4.11-failure.yml new file mode 100644 index 0000000000..a8d1bcd923 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/AsciiStringLiterals/single/generated/0.4.11-failure.yml @@ -0,0 +1,17 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ "foo" │ 0..5 + +Errors: # 1 total + - > + Error: Expected end of file. + ╭─[crates/solidity/testing/snapshots/cst_output/AsciiStringLiterals/single/input.sol:1:1] + │ + 1 │ "foo" + │ ──┬── + │ ╰──── Error occurred here. + ───╯ + +Tree: + - (SKIPPED): '"foo"' # (0..5) diff --git a/crates/solidity/testing/snapshots/cst_output/AsciiStringLiterals/single/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/AsciiStringLiterals/single/generated/0.5.14-success.yml similarity index 100% rename from crates/solidity/testing/snapshots/cst_output/AsciiStringLiterals/single/generated/0.4.11-success.yml rename to crates/solidity/testing/snapshots/cst_output/AsciiStringLiterals/single/generated/0.5.14-success.yml diff --git a/crates/solidity/testing/snapshots/cst_output/AsciiStringLiterals/single_trailing_ident/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/AsciiStringLiterals/single_trailing_ident/generated/0.4.11-failure.yml index 0299b7d9f6..bcf4597e14 100644 --- a/crates/solidity/testing/snapshots/cst_output/AsciiStringLiterals/single_trailing_ident/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/AsciiStringLiterals/single_trailing_ident/generated/0.4.11-failure.yml @@ -5,15 +5,13 @@ Source: > Errors: # 1 total - > - Error: Expected AsciiStringLiteral. - ╭─[crates/solidity/testing/snapshots/cst_output/AsciiStringLiterals/single_trailing_ident/input.sol:1:6] + Error: Expected end of file. + ╭─[crates/solidity/testing/snapshots/cst_output/AsciiStringLiterals/single_trailing_ident/input.sol:1:1] │ 1 │ "foo"bar - │ ──┬─ - │ ╰─── Error occurred here. + │ ────┬──── + │ ╰────── Error occurred here. ───╯ Tree: - - (AsciiStringLiterals): # '"foo"bar\n' (0..9) - - (item꞉ AsciiStringLiteral): '"foo"' # (0..5) - - (SKIPPED): "bar\n" # (5..9) + - (SKIPPED): '"foo"bar\n' # (0..9) diff --git a/crates/solidity/testing/snapshots/cst_output/AsciiStringLiterals/single_trailing_ident/generated/0.5.14-failure.yml b/crates/solidity/testing/snapshots/cst_output/AsciiStringLiterals/single_trailing_ident/generated/0.5.14-failure.yml new file mode 100644 index 0000000000..0299b7d9f6 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/AsciiStringLiterals/single_trailing_ident/generated/0.5.14-failure.yml @@ -0,0 +1,19 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ "foo"bar │ 0..8 + +Errors: # 1 total + - > + Error: Expected AsciiStringLiteral. + ╭─[crates/solidity/testing/snapshots/cst_output/AsciiStringLiterals/single_trailing_ident/input.sol:1:6] + │ + 1 │ "foo"bar + │ ──┬─ + │ ╰─── Error occurred here. + ───╯ + +Tree: + - (AsciiStringLiterals): # '"foo"bar\n' (0..9) + - (item꞉ AsciiStringLiteral): '"foo"' # (0..5) + - (SKIPPED): "bar\n" # (5..9) 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 b58f1e2dce..27e6fa159b 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 @@ -91,9 +91,9 @@ Tree: - (LeadingTrivia) ► (Whitespace): " " # (158..159) - (variant꞉ Identifier): "amount" # (159..165) - (separator꞉ Comma): "," # (165..166) - - (item꞉ Expression) ► (variant꞉ StringExpression) ► (variant꞉ AsciiStringLiterals): # ' "Address: insufficient balance"' (166..198) + - (item꞉ Expression) ► (variant꞉ StringExpression): # ' "Address: insufficient balance"' (166..198) - (LeadingTrivia) ► (Whitespace): " " # (166..167) - - (item꞉ AsciiStringLiteral): '"Address: insufficient balance"' # (167..198) + - (variant꞉ AsciiStringLiteral): '"Address: insufficient balance"' # (167..198) - (close_paren꞉ CloseParen): ")" # (198..199) - (semicolon꞉ Semicolon): ";" # (199..200) - (TrailingTrivia) ► (EndOfLine): "\n" # (200..201) @@ -132,9 +132,9 @@ Tree: - (arguments꞉ PositionalArguments): # 'success, "Address: unable to send value, recipient...' (274..343) - (item꞉ Expression) ► (variant꞉ Identifier): "success" # (274..281) - (separator꞉ Comma): "," # (281..282) - - (item꞉ Expression) ► (variant꞉ StringExpression) ► (variant꞉ AsciiStringLiterals): # ' "Address: unable to send value, recipient may hav...' (282..343) + - (item꞉ Expression) ► (variant꞉ StringExpression): # ' "Address: unable to send value, recipient may hav...' (282..343) - (LeadingTrivia) ► (Whitespace): " " # (282..283) - - (item꞉ AsciiStringLiteral): '"Address: unable to send value, recipient may have...' # (283..343) + - (variant꞉ AsciiStringLiteral): '"Address: unable to send value, recipient may have...' # (283..343) - (close_paren꞉ CloseParen): ")" # (343..344) - (semicolon꞉ Semicolon): ";" # (344..345) - (TrailingTrivia) ► (EndOfLine): "\n" # (345..346) diff --git a/crates/solidity/testing/snapshots/cst_output/ContractDefinition/function_multiple_delimiters/generated/0.5.14-failure.yml b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/function_multiple_delimiters/generated/0.5.14-failure.yml new file mode 100644 index 0000000000..b58f1e2dce --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/ContractDefinition/function_multiple_delimiters/generated/0.5.14-failure.yml @@ -0,0 +1,145 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ // SPDX-License-Identifier: MIT │ 0..31 + 2 │ contract ABC { │ 32..46 + 3 │ function sendValue(address payable recipient, uint256 amount) internal { │ 47..121 + 4 │ require(address(this).balance >= amount, "Address: insufficient balance"); │ 122..200 + 5 │ │ 201..201 + 6 │ (bool success, ) = recipient.call{ value: amount }(""); │ 202..261 + 7 │ require(success, "Address: unable to send value, recipient may have reverted"); │ 262..345 + 8 │ } │ 346..349 + 9 │ } │ 350..351 + +Errors: # 1 total + - > + Error: Expected Semicolon. + ╭─[crates/solidity/testing/snapshots/cst_output/ContractDefinition/function_multiple_delimiters/input.sol:6:38] + │ + 6 │ (bool success, ) = recipient.call{ value: amount }(""); + │ ──────────┬────────── + │ ╰──────────── Error occurred here. + ───╯ + +Tree: + - (ContractDefinition): # "// SPDX-License-Identifier: MIT\ncontract ABC {\n f..." (0..352) + - (LeadingTrivia): # "// SPDX-License-Identifier: MIT\n" (0..32) + - (SingleLineComment): "// SPDX-License-Identifier: MIT" # (0..31) + - (EndOfLine): "\n" # (31..32) + - (contract_keyword꞉ ContractKeyword): "contract" # (32..40) + - (LeadingTrivia) ► (Whitespace): " " # (40..41) + - (name꞉ Identifier): "ABC" # (41..44) + - (LeadingTrivia) ► (Whitespace): " " # (44..45) + - (open_brace꞉ OpenBrace): "{" # (45..46) + - (TrailingTrivia) ► (EndOfLine): "\n" # (46..47) + - (members꞉ ContractMembers): # " function sendValue(address payable recipient, ui..." (47..350) + - (item꞉ ContractMember) ► (variant꞉ FunctionDefinition): # " function sendValue(address payable recipient, ui..." (47..350) + - (LeadingTrivia) ► (Whitespace): " " # (47..49) + - (function_keyword꞉ FunctionKeyword): "function" # (49..57) + - (name꞉ FunctionName): # " sendValue" (57..67) + - (LeadingTrivia) ► (Whitespace): " " # (57..58) + - (variant꞉ Identifier): "sendValue" # (58..67) + - (parameters꞉ ParametersDeclaration): # "(address payable recipient, uint256 amount)" (67..110) + - (open_paren꞉ OpenParen): "(" # (67..68) + - (parameters꞉ Parameters): # "address payable recipient, uint256 amount" (68..109) + - (item꞉ Parameter): # "address payable recipient" (68..93) + - (type_name꞉ TypeName) ► (variant꞉ ElementaryType) ► (variant꞉ AddressType): # "address payable" (68..83) + - (address_keyword꞉ AddressKeyword): "address" # (68..75) + - (LeadingTrivia) ► (Whitespace): " " # (75..76) + - (payable_keyword꞉ PayableKeyword): "payable" # (76..83) + - (LeadingTrivia) ► (Whitespace): " " # (83..84) + - (name꞉ Identifier): "recipient" # (84..93) + - (separator꞉ Comma): "," # (93..94) + - (item꞉ Parameter): # " uint256 amount" (94..109) + - (type_name꞉ TypeName) ► (variant꞉ ElementaryType): # " uint256" (94..102) + - (LeadingTrivia) ► (Whitespace): " " # (94..95) + - (variant꞉ UintKeyword): "uint256" # (95..102) + - (LeadingTrivia) ► (Whitespace): " " # (102..103) + - (name꞉ Identifier): "amount" # (103..109) + - (close_paren꞉ CloseParen): ")" # (109..110) + - (attributes꞉ FunctionAttributes): # " internal" (110..119) + - (item꞉ FunctionAttribute): # " internal" (110..119) + - (LeadingTrivia) ► (Whitespace): " " # (110..111) + - (variant꞉ InternalKeyword): "internal" # (111..119) + - (body꞉ FunctionBody) ► (variant꞉ Block): # ' {\n require(address(this).balance >= amount, "A...' (119..350) + - (LeadingTrivia) ► (Whitespace): " " # (119..120) + - (open_brace꞉ OpenBrace): "{" # (120..121) + - (TrailingTrivia) ► (EndOfLine): "\n" # (121..122) + - (statements꞉ Statements): # ' require(address(this).balance >= amount, "Addr...' (122..346) + - (item꞉ Statement) ► (variant꞉ ExpressionStatement): # ' require(address(this).balance >= amount, "Addr...' (122..201) + - (expression꞉ Expression) ► (variant꞉ FunctionCallExpression): # ' require(address(this).balance >= amount, "Addr...' (122..199) + - (operand꞉ Expression): # " require" (122..133) + - (LeadingTrivia) ► (Whitespace): " " # (122..126) + - (variant꞉ Identifier): "require" # (126..133) + - (arguments꞉ ArgumentsDeclaration) ► (variant꞉ PositionalArgumentsDeclaration): # '(address(this).balance >= amount, "Address: insuff...' (133..199) + - (open_paren꞉ OpenParen): "(" # (133..134) + - (arguments꞉ PositionalArguments): # 'address(this).balance >= amount, "Address: insuffi...' (134..198) + - (item꞉ Expression) ► (variant꞉ ComparisonExpression): # "address(this).balance >= amount" (134..165) + - (left_operand꞉ Expression) ► (variant꞉ MemberAccessExpression): # "address(this).balance" (134..155) + - (operand꞉ Expression) ► (variant꞉ FunctionCallExpression): # "address(this)" (134..147) + - (operand꞉ Expression) ► (variant꞉ ElementaryType) ► (variant꞉ AddressType) ► (address_keyword꞉ AddressKeyword): "address" # (134..141) + - (arguments꞉ ArgumentsDeclaration) ► (variant꞉ PositionalArgumentsDeclaration): # "(this)" (141..147) + - (open_paren꞉ OpenParen): "(" # (141..142) + - (arguments꞉ PositionalArguments): # "this" (142..146) + - (item꞉ Expression) ► (variant꞉ Identifier): "this" # (142..146) + - (close_paren꞉ CloseParen): ")" # (146..147) + - (period꞉ Period): "." # (147..148) + - (member꞉ MemberAccess) ► (variant꞉ Identifier): "balance" # (148..155) + - (LeadingTrivia) ► (Whitespace): " " # (155..156) + - (operator꞉ GreaterThanEqual): ">=" # (156..158) + - (right_operand꞉ Expression): # " amount" (158..165) + - (LeadingTrivia) ► (Whitespace): " " # (158..159) + - (variant꞉ Identifier): "amount" # (159..165) + - (separator꞉ Comma): "," # (165..166) + - (item꞉ Expression) ► (variant꞉ StringExpression) ► (variant꞉ AsciiStringLiterals): # ' "Address: insufficient balance"' (166..198) + - (LeadingTrivia) ► (Whitespace): " " # (166..167) + - (item꞉ AsciiStringLiteral): '"Address: insufficient balance"' # (167..198) + - (close_paren꞉ CloseParen): ")" # (198..199) + - (semicolon꞉ Semicolon): ";" # (199..200) + - (TrailingTrivia) ► (EndOfLine): "\n" # (200..201) + - (item꞉ Statement) ► (variant꞉ TupleDeconstructionStatement): # "\n (bool success, ) = recipient.call{ value: amo..." (201..262) + - (LeadingTrivia): # "\n " (201..206) + - (EndOfLine): "\n" # (201..202) + - (Whitespace): " " # (202..206) + - (open_paren꞉ OpenParen): "(" # (206..207) + - (elements꞉ TupleDeconstructionElements): # "bool success," (207..220) + - (item꞉ TupleDeconstructionElement) ► (member꞉ TupleMember) ► (variant꞉ TypedTupleMember): # "bool success" (207..219) + - (type_name꞉ TypeName) ► (variant꞉ ElementaryType) ► (variant꞉ BoolKeyword): "bool" # (207..211) + - (LeadingTrivia) ► (Whitespace): " " # (211..212) + - (name꞉ Identifier): "success" # (212..219) + - (separator꞉ Comma): "," # (219..220) + - (item꞉ TupleDeconstructionElement): [] # (220..220) + - (LeadingTrivia) ► (Whitespace): " " # (220..221) + - (close_paren꞉ CloseParen): ")" # (221..222) + - (LeadingTrivia) ► (Whitespace): " " # (222..223) + - (equal꞉ Equal): "=" # (223..224) + - (expression꞉ Expression) ► (variant꞉ MemberAccessExpression): # " recipient.call" (224..239) + - (operand꞉ Expression): # " recipient" (224..234) + - (LeadingTrivia) ► (Whitespace): " " # (224..225) + - (variant꞉ Identifier): "recipient" # (225..234) + - (period꞉ Period): "." # (234..235) + - (member꞉ MemberAccess) ► (variant꞉ Identifier): "call" # (235..239) + - (SKIPPED): '{ value: amount }("")' # (239..260) + - (semicolon꞉ Semicolon): ";" # (260..261) + - (TrailingTrivia) ► (EndOfLine): "\n" # (261..262) + - (item꞉ Statement) ► (variant꞉ ExpressionStatement): # ' require(success, "Address: unable to send valu...' (262..346) + - (expression꞉ Expression) ► (variant꞉ FunctionCallExpression): # ' require(success, "Address: unable to send valu...' (262..344) + - (operand꞉ Expression): # " require" (262..273) + - (LeadingTrivia) ► (Whitespace): " " # (262..266) + - (variant꞉ Identifier): "require" # (266..273) + - (arguments꞉ ArgumentsDeclaration) ► (variant꞉ PositionalArgumentsDeclaration): # '(success, "Address: unable to send value, recipien...' (273..344) + - (open_paren꞉ OpenParen): "(" # (273..274) + - (arguments꞉ PositionalArguments): # 'success, "Address: unable to send value, recipient...' (274..343) + - (item꞉ Expression) ► (variant꞉ Identifier): "success" # (274..281) + - (separator꞉ Comma): "," # (281..282) + - (item꞉ Expression) ► (variant꞉ StringExpression) ► (variant꞉ AsciiStringLiterals): # ' "Address: unable to send value, recipient may hav...' (282..343) + - (LeadingTrivia) ► (Whitespace): " " # (282..283) + - (item꞉ AsciiStringLiteral): '"Address: unable to send value, recipient may have...' # (283..343) + - (close_paren꞉ CloseParen): ")" # (343..344) + - (semicolon꞉ Semicolon): ";" # (344..345) + - (TrailingTrivia) ► (EndOfLine): "\n" # (345..346) + - (LeadingTrivia) ► (Whitespace): " " # (346..348) + - (close_brace꞉ CloseBrace): "}" # (348..349) + - (TrailingTrivia) ► (EndOfLine): "\n" # (349..350) + - (close_brace꞉ CloseBrace): "}" # (350..351) + - (TrailingTrivia) ► (EndOfLine): "\n" # (351..352) diff --git a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/all_separated_pairs/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/all_separated_pairs/generated/0.4.11-failure.yml new file mode 100644 index 0000000000..39dfc86602 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/all_separated_pairs/generated/0.4.11-failure.yml @@ -0,0 +1,17 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ hex"12_34_56_78_90_ab_cd_ef" │ 0..28 + +Errors: # 1 total + - > + Error: Expected end of file. + ╭─[crates/solidity/testing/snapshots/cst_output/HexStringLiterals/all_separated_pairs/input.sol:1:1] + │ + 1 │ hex"12_34_56_78_90_ab_cd_ef" + │ ──────────────┬───────────── + │ ╰─────────────── Error occurred here. + ───╯ + +Tree: + - (SKIPPED): 'hex"12_34_56_78_90_ab_cd_ef"' # (0..28) diff --git a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/all_separated_pairs/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/all_separated_pairs/generated/0.5.14-success.yml similarity index 100% rename from crates/solidity/testing/snapshots/cst_output/HexStringLiterals/all_separated_pairs/generated/0.4.11-success.yml rename to crates/solidity/testing/snapshots/cst_output/HexStringLiterals/all_separated_pairs/generated/0.5.14-success.yml diff --git a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_consecutive_separators/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_consecutive_separators/generated/0.4.11-failure.yml index c23d77456b..d256a9fd3d 100644 --- a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_consecutive_separators/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_consecutive_separators/generated/0.4.11-failure.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected HexStringLiteral. + Error: Expected end of file. ╭─[crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_consecutive_separators/input.sol:1:1] │ 1 │ hex"12__34" diff --git a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_consecutive_separators/generated/0.5.14-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_consecutive_separators/generated/0.5.14-failure.yml new file mode 100644 index 0000000000..c23d77456b --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_consecutive_separators/generated/0.5.14-failure.yml @@ -0,0 +1,17 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ hex"12__34" │ 0..11 + +Errors: # 1 total + - > + Error: Expected HexStringLiteral. + ╭─[crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_consecutive_separators/input.sol:1:1] + │ + 1 │ hex"12__34" + │ ─────┬───── + │ ╰─────── Error occurred here. + ───╯ + +Tree: + - (SKIPPED): 'hex"12__34"' # (0..11) diff --git a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_leading_separator/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_leading_separator/generated/0.4.11-failure.yml index 20f86997ac..8212c5a3f3 100644 --- a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_leading_separator/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_leading_separator/generated/0.4.11-failure.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected HexStringLiteral. + Error: Expected end of file. ╭─[crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_leading_separator/input.sol:1:1] │ 1 │ hex"_1234" diff --git a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_leading_separator/generated/0.5.14-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_leading_separator/generated/0.5.14-failure.yml new file mode 100644 index 0000000000..20f86997ac --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_leading_separator/generated/0.5.14-failure.yml @@ -0,0 +1,17 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ hex"_1234" │ 0..10 + +Errors: # 1 total + - > + Error: Expected HexStringLiteral. + ╭─[crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_leading_separator/input.sol:1:1] + │ + 1 │ hex"_1234" + │ ─────┬──── + │ ╰────── Error occurred here. + ───╯ + +Tree: + - (SKIPPED): 'hex"_1234"' # (0..10) diff --git a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_separator_after_single_char/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_separator_after_single_char/generated/0.4.11-failure.yml index 76b1b64255..e1dab0fb3c 100644 --- a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_separator_after_single_char/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_separator_after_single_char/generated/0.4.11-failure.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected HexStringLiteral. + Error: Expected end of file. ╭─[crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_separator_after_single_char/input.sol:1:1] │ 1 │ hex"1_2" diff --git a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_separator_after_single_char/generated/0.5.14-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_separator_after_single_char/generated/0.5.14-failure.yml new file mode 100644 index 0000000000..76b1b64255 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_separator_after_single_char/generated/0.5.14-failure.yml @@ -0,0 +1,17 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ hex"1_2" │ 0..8 + +Errors: # 1 total + - > + Error: Expected HexStringLiteral. + ╭─[crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_separator_after_single_char/input.sol:1:1] + │ + 1 │ hex"1_2" + │ ────┬─── + │ ╰───── Error occurred here. + ───╯ + +Tree: + - (SKIPPED): 'hex"1_2"' # (0..8) diff --git a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_trailing_separator/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_trailing_separator/generated/0.4.11-failure.yml index a2f82c5ca1..e103c02e0e 100644 --- a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_trailing_separator/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_trailing_separator/generated/0.4.11-failure.yml @@ -5,7 +5,7 @@ Source: > Errors: # 1 total - > - Error: Expected HexStringLiteral. + Error: Expected end of file. ╭─[crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_trailing_separator/input.sol:1:1] │ 1 │ hex"1234_" diff --git a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_trailing_separator/generated/0.5.14-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_trailing_separator/generated/0.5.14-failure.yml new file mode 100644 index 0000000000..a2f82c5ca1 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_trailing_separator/generated/0.5.14-failure.yml @@ -0,0 +1,17 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ hex"1234_" │ 0..10 + +Errors: # 1 total + - > + Error: Expected HexStringLiteral. + ╭─[crates/solidity/testing/snapshots/cst_output/HexStringLiterals/invalid_trailing_separator/input.sol:1:1] + │ + 1 │ hex"1234_" + │ ─────┬──── + │ ╰────── Error occurred here. + ───╯ + +Tree: + - (SKIPPED): 'hex"1234_"' # (0..10) diff --git a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/multiple/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/multiple/generated/0.4.11-failure.yml new file mode 100644 index 0000000000..ce3e77b597 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/multiple/generated/0.4.11-failure.yml @@ -0,0 +1,17 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ hex"ab" hex'cd' │ 0..15 + +Errors: # 1 total + - > + Error: Expected end of file. + ╭─[crates/solidity/testing/snapshots/cst_output/HexStringLiterals/multiple/input.sol:1:1] + │ + 1 │ hex"ab" hex'cd' + │ ───────┬─────── + │ ╰───────── Error occurred here. + ───╯ + +Tree: + - (SKIPPED): 'hex"ab" hex''cd''' # (0..15) diff --git a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/multiple/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/multiple/generated/0.5.14-success.yml similarity index 100% rename from crates/solidity/testing/snapshots/cst_output/HexStringLiterals/multiple/generated/0.4.11-success.yml rename to crates/solidity/testing/snapshots/cst_output/HexStringLiterals/multiple/generated/0.5.14-success.yml diff --git a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/no_separators/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/no_separators/generated/0.4.11-failure.yml new file mode 100644 index 0000000000..6d5281fbfa --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/no_separators/generated/0.4.11-failure.yml @@ -0,0 +1,17 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ hex"1234567890abcdef" │ 0..21 + +Errors: # 1 total + - > + Error: Expected end of file. + ╭─[crates/solidity/testing/snapshots/cst_output/HexStringLiterals/no_separators/input.sol:1:1] + │ + 1 │ hex"1234567890abcdef" + │ ──────────┬────────── + │ ╰──────────── Error occurred here. + ───╯ + +Tree: + - (SKIPPED): 'hex"1234567890abcdef"' # (0..21) diff --git a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/no_separators/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/no_separators/generated/0.5.14-success.yml similarity index 100% rename from crates/solidity/testing/snapshots/cst_output/HexStringLiterals/no_separators/generated/0.4.11-success.yml rename to crates/solidity/testing/snapshots/cst_output/HexStringLiterals/no_separators/generated/0.5.14-success.yml diff --git a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/single/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/single/generated/0.4.11-failure.yml new file mode 100644 index 0000000000..54d47f8e4f --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/single/generated/0.4.11-failure.yml @@ -0,0 +1,17 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ hex"abcdef" │ 0..11 + +Errors: # 1 total + - > + Error: Expected end of file. + ╭─[crates/solidity/testing/snapshots/cst_output/HexStringLiterals/single/input.sol:1:1] + │ + 1 │ hex"abcdef" + │ ─────┬───── + │ ╰─────── Error occurred here. + ───╯ + +Tree: + - (SKIPPED): 'hex"abcdef"' # (0..11) diff --git a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/single/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/single/generated/0.5.14-success.yml similarity index 100% rename from crates/solidity/testing/snapshots/cst_output/HexStringLiterals/single/generated/0.4.11-success.yml rename to crates/solidity/testing/snapshots/cst_output/HexStringLiterals/single/generated/0.5.14-success.yml diff --git a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/single_trailing_ident/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/single_trailing_ident/generated/0.4.11-failure.yml index a3b8cd31dd..8ce15bcab5 100644 --- a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/single_trailing_ident/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/single_trailing_ident/generated/0.4.11-failure.yml @@ -5,15 +5,13 @@ Source: > Errors: # 1 total - > - Error: Expected HexStringLiteral. - ╭─[crates/solidity/testing/snapshots/cst_output/HexStringLiterals/single_trailing_ident/input.sol:1:8] + Error: Expected end of file. + ╭─[crates/solidity/testing/snapshots/cst_output/HexStringLiterals/single_trailing_ident/input.sol:1:1] │ 1 │ hex"12"b - │ ─┬ - │ ╰── Error occurred here. + │ ────┬──── + │ ╰────── Error occurred here. ───╯ Tree: - - (HexStringLiterals): # 'hex"12"b\n' (0..9) - - (item꞉ HexStringLiteral): 'hex"12"' # (0..7) - - (SKIPPED): "b\n" # (7..9) + - (SKIPPED): 'hex"12"b\n' # (0..9) diff --git a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/single_trailing_ident/generated/0.5.14-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/single_trailing_ident/generated/0.5.14-failure.yml new file mode 100644 index 0000000000..a3b8cd31dd --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/single_trailing_ident/generated/0.5.14-failure.yml @@ -0,0 +1,19 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ hex"12"b │ 0..8 + +Errors: # 1 total + - > + Error: Expected HexStringLiteral. + ╭─[crates/solidity/testing/snapshots/cst_output/HexStringLiterals/single_trailing_ident/input.sol:1:8] + │ + 1 │ hex"12"b + │ ─┬ + │ ╰── Error occurred here. + ───╯ + +Tree: + - (HexStringLiterals): # 'hex"12"b\n' (0..9) + - (item꞉ HexStringLiteral): 'hex"12"' # (0..7) + - (SKIPPED): "b\n" # (7..9) diff --git a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/some_separated_pairs/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/some_separated_pairs/generated/0.4.11-failure.yml new file mode 100644 index 0000000000..8f2ce30cfd --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/some_separated_pairs/generated/0.4.11-failure.yml @@ -0,0 +1,17 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ hex"1234_5678_90ab_cdef" │ 0..24 + +Errors: # 1 total + - > + Error: Expected end of file. + ╭─[crates/solidity/testing/snapshots/cst_output/HexStringLiterals/some_separated_pairs/input.sol:1:1] + │ + 1 │ hex"1234_5678_90ab_cdef" + │ ────────────┬─────────── + │ ╰───────────── Error occurred here. + ───╯ + +Tree: + - (SKIPPED): 'hex"1234_5678_90ab_cdef"' # (0..24) diff --git a/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/some_separated_pairs/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/HexStringLiterals/some_separated_pairs/generated/0.5.14-success.yml similarity index 100% rename from crates/solidity/testing/snapshots/cst_output/HexStringLiterals/some_separated_pairs/generated/0.4.11-success.yml rename to crates/solidity/testing/snapshots/cst_output/HexStringLiterals/some_separated_pairs/generated/0.5.14-success.yml