diff --git a/.changeset/modern-rocks-change.md b/.changeset/modern-rocks-change.md new file mode 100644 index 0000000000..e705e1359e --- /dev/null +++ b/.changeset/modern-rocks-change.md @@ -0,0 +1,5 @@ +--- +"@nomicfoundation/slang": patch +--- + +allow parsing `ColonEqual` as two separate tokens before `0.5.5` diff --git a/crates/solidity/inputs/language/src/definition.rs b/crates/solidity/inputs/language/src/definition.rs index e0320df567..668f3b2b51 100644 --- a/crates/solidity/inputs/language/src/definition.rs +++ b/crates/solidity/inputs/language/src/definition.rs @@ -1849,7 +1849,12 @@ codegen_language_macros::compile!(Language( ), Token( name = Colon, - definitions = [TokenDefinition(scanner = Atom(":"))] + definitions = [TokenDefinition( + scanner = TrailingContext( + scanner = Atom(":"), + not_followed_by = Atom("=") + ) + )] ), Token( name = ColonEqual, @@ -4061,7 +4066,7 @@ codegen_language_macros::compile!(Language( Struct( name = YulVariableDeclarationValue, fields = ( - colon_equal = Required(ColonEqual), + assignment = Required(YulAssignmentOperator), expression = Required(YulExpression) ) ), @@ -4069,10 +4074,22 @@ codegen_language_macros::compile!(Language( name = YulAssignmentStatement, fields = ( names = Required(YulIdentifierPaths), - colon_equal = Required(ColonEqual), + assignment = Required(YulAssignmentOperator), expression = Required(YulExpression) ) ), + Enum( + name = YulAssignmentOperator, + variants = [ + EnumVariant(reference = YulColonAndEqual, enabled = Till("0.5.5")), + EnumVariant(reference = ColonEqual) + ] + ), + Struct( + name = YulColonAndEqual, + enabled = Till("0.5.5"), + fields = (colon = Required(Colon), equal = Required(Equal)) + ), Struct( name = YulIfStatement, fields = ( diff --git a/crates/solidity/outputs/cargo/slang_solidity/src/generated/kinds.rs b/crates/solidity/outputs/cargo/slang_solidity/src/generated/kinds.rs index 40dcfad4ab..19bb0eae8c 100644 --- a/crates/solidity/outputs/cargo/slang_solidity/src/generated/kinds.rs +++ b/crates/solidity/outputs/cargo/slang_solidity/src/generated/kinds.rs @@ -204,10 +204,12 @@ pub enum RuleKind { VersionPragmaSpecifier, WhileStatement, YulArguments, + YulAssignmentOperator, YulAssignmentStatement, YulBlock, YulBreakStatement, YulBuiltInFunction, + YulColonAndEqual, YulContinueStatement, YulDefaultCase, YulExpression, @@ -277,6 +279,7 @@ pub enum FieldName { Arguments, AsKeyword, AssemblyKeyword, + Assignment, Asterisk, Attributes, Block, @@ -291,7 +294,6 @@ pub enum FieldName { CloseBracket, CloseParen, Colon, - ColonEqual, Condition, ConstantKeyword, ConstructorKeyword, 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 a115a3726d..3847078b62 100644 --- a/crates/solidity/outputs/cargo/slang_solidity/src/generated/language.rs +++ b/crates/solidity/outputs/cargo/slang_solidity/src/generated/language.rs @@ -37,6 +37,7 @@ pub struct Language { pub(crate) version_is_at_least_0_4_22: bool, pub(crate) version_is_at_least_0_5_0: bool, pub(crate) version_is_at_least_0_5_3: bool, + pub(crate) version_is_at_least_0_5_5: 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, @@ -166,6 +167,7 @@ impl Language { version_is_at_least_0_4_22: Version::new(0, 4, 22) <= version, version_is_at_least_0_5_0: Version::new(0, 5, 0) <= version, version_is_at_least_0_5_3: Version::new(0, 5, 3) <= version, + version_is_at_least_0_5_5: Version::new(0, 5, 5) <= 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, @@ -5849,17 +5851,27 @@ impl Language { .with_kind(RuleKind::YulArguments) } + #[allow(unused_assignments, unused_parens)] + fn yul_assignment_operator(&self, input: &mut ParserContext<'_>) -> ParserResult { + ChoiceHelper::run(input, |mut choice, input| { + if !self.version_is_at_least_0_5_5 { + let result = self.yul_colon_and_equal(input); + choice.consider(input, result)?; + } + let result = self + .parse_token_with_trivia::(input, TokenKind::ColonEqual); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_name(FieldName::Variant) + .with_kind(RuleKind::YulAssignmentOperator) + } + #[allow(unused_assignments, unused_parens)] fn yul_assignment_statement(&self, input: &mut ParserContext<'_>) -> ParserResult { SequenceHelper::run(|mut seq| { seq.elem_named(FieldName::Names, self.yul_identifier_paths(input))?; - seq.elem_named( - FieldName::ColonEqual, - self.parse_token_with_trivia::( - input, - TokenKind::ColonEqual, - ), - )?; + seq.elem_named(FieldName::Assignment, self.yul_assignment_operator(input))?; seq.elem_named(FieldName::Expression, self.yul_expression(input))?; seq.finish() }) @@ -6310,6 +6322,32 @@ impl Language { .with_kind(RuleKind::YulBuiltInFunction) } + #[allow(unused_assignments, unused_parens)] + fn yul_colon_and_equal(&self, input: &mut ParserContext<'_>) -> ParserResult { + if !self.version_is_at_least_0_5_5 { + SequenceHelper::run(|mut seq| { + seq.elem_named( + FieldName::Colon, + self.parse_token_with_trivia::( + input, + TokenKind::Colon, + ), + )?; + seq.elem_named( + FieldName::Equal, + self.parse_token_with_trivia::( + input, + TokenKind::Equal, + ), + )?; + seq.finish() + }) + } else { + ParserResult::disabled() + } + .with_kind(RuleKind::YulColonAndEqual) + } + #[allow(unused_assignments, unused_parens)] fn yul_continue_statement(&self, input: &mut ParserContext<'_>) -> ParserResult { self.parse_token_with_trivia::( @@ -6808,13 +6846,7 @@ impl Language { #[allow(unused_assignments, unused_parens)] fn yul_variable_declaration_value(&self, input: &mut ParserContext<'_>) -> ParserResult { SequenceHelper::run(|mut seq| { - seq.elem_named( - FieldName::ColonEqual, - self.parse_token_with_trivia::( - input, - TokenKind::ColonEqual, - ), - )?; + seq.elem_named(FieldName::Assignment, self.yul_assignment_operator(input))?; seq.elem_named(FieldName::Expression, self.yul_expression(input))?; seq.finish() }) @@ -6840,6 +6872,11 @@ impl Language { ) } + #[allow(unused_assignments, unused_parens)] + fn colon(&self, input: &mut ParserContext<'_>) -> bool { + scan_not_followed_by!(input, scan_chars!(input, ':'), scan_chars!(input, '=')) + } + #[allow(unused_assignments, unused_parens)] fn decimal_digits(&self, input: &mut ParserContext<'_>) -> bool { scan_sequence!( @@ -9150,12 +9187,16 @@ impl Language { } RuleKind::WhileStatement => Self::while_statement.parse(self, input, true), RuleKind::YulArguments => Self::yul_arguments.parse(self, input, true), + RuleKind::YulAssignmentOperator => { + Self::yul_assignment_operator.parse(self, input, true) + } RuleKind::YulAssignmentStatement => { Self::yul_assignment_statement.parse(self, input, true) } RuleKind::YulBlock => Self::yul_block.parse(self, input, true), RuleKind::YulBreakStatement => Self::yul_break_statement.parse(self, input, true), RuleKind::YulBuiltInFunction => Self::yul_built_in_function.parse(self, input, true), + RuleKind::YulColonAndEqual => Self::yul_colon_and_equal.parse(self, input, true), RuleKind::YulContinueStatement => Self::yul_continue_statement.parse(self, input, true), RuleKind::YulDefaultCase => Self::yul_default_case.parse(self, input, true), RuleKind::YulExpression => Self::yul_expression.parse(self, input, true), @@ -9307,7 +9348,6 @@ impl Lexer for Language { None } } - Some(':') => Some(TokenKind::Colon), Some(';') => Some(TokenKind::Semicolon), Some('<') => match input.next() { Some('<') => match input.next() { @@ -9395,6 +9435,7 @@ impl Lexer for Language { input.set_position(save); longest_match! { + { Colon = colon } { DecimalLiteral = decimal_literal } { DoubleQuotedHexStringLiteral = double_quoted_hex_string_literal } { DoubleQuotedStringLiteral = double_quoted_string_literal } @@ -10751,14 +10792,14 @@ impl Lexer for Language { } } Some('.') => Some(TokenKind::Period), - Some(':') => match input.next() { - Some('=') => Some(TokenKind::ColonEqual), - Some(_) => { - input.undo(); - Some(TokenKind::Colon) + Some(':') => { + if scan_chars!(input, '=') { + Some(TokenKind::ColonEqual) + } else { + None } - None => Some(TokenKind::Colon), - }, + } + Some('=') => Some(TokenKind::Equal), Some('{') => Some(TokenKind::OpenBrace), Some('}') => Some(TokenKind::CloseBrace), Some(_) => { @@ -10773,6 +10814,7 @@ impl Lexer for Language { input.set_position(save); longest_match! { + { Colon = colon } { YulDecimalLiteral = yul_decimal_literal } { YulHexLiteral = yul_hex_literal } } 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 f03bf2b708..a0a3eb8161 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 @@ -147,6 +147,7 @@ pub fn select_sequence( } RuleKind::YulVariableDeclarationValue => selector.yul_variable_declaration_value()?, RuleKind::YulAssignmentStatement => selector.yul_assignment_statement()?, + RuleKind::YulColonAndEqual => selector.yul_colon_and_equal()?, RuleKind::YulIfStatement => selector.yul_if_statement()?, RuleKind::YulForStatement => selector.yul_for_statement()?, RuleKind::YulSwitchStatement => selector.yul_switch_statement()?, @@ -1357,7 +1358,7 @@ impl Selector { impl Selector { fn yul_variable_declaration_value(&mut self) -> Result>> { Ok(vec![ - Some(self.select(|node| node.is_token_with_kind(TokenKind::ColonEqual))?), + Some(self.select(|node| node.is_rule_with_kind(RuleKind::YulAssignmentOperator))?), Some(self.select(|node| node.is_rule_with_kind(RuleKind::YulExpression))?), ]) } @@ -1367,12 +1368,21 @@ impl Selector { fn yul_assignment_statement(&mut self) -> Result>> { Ok(vec![ Some(self.select(|node| node.is_rule_with_kind(RuleKind::YulIdentifierPaths))?), - Some(self.select(|node| node.is_token_with_kind(TokenKind::ColonEqual))?), + Some(self.select(|node| node.is_rule_with_kind(RuleKind::YulAssignmentOperator))?), Some(self.select(|node| node.is_rule_with_kind(RuleKind::YulExpression))?), ]) } } +impl Selector { + fn yul_colon_and_equal(&mut self) -> Result>> { + Ok(vec![ + Some(self.select(|node| node.is_token_with_kind(TokenKind::Colon))?), + Some(self.select(|node| node.is_token_with_kind(TokenKind::Equal))?), + ]) + } +} + impl Selector { fn yul_if_statement(&mut self) -> Result>> { Ok(vec![ @@ -1518,6 +1528,7 @@ pub fn select_choice( RuleKind::HexStringLiteral => selector.hex_string_literal()?, RuleKind::UnicodeStringLiteral => selector.unicode_string_literal()?, RuleKind::YulStatement => selector.yul_statement()?, + RuleKind::YulAssignmentOperator => selector.yul_assignment_operator()?, RuleKind::YulSwitchCase => selector.yul_switch_case()?, RuleKind::YulExpression => selector.yul_expression()?, RuleKind::YulBuiltInFunction => selector.yul_built_in_function()?, @@ -2073,6 +2084,15 @@ impl Selector { } } +impl Selector { + fn yul_assignment_operator(&mut self) -> Result { + self.select(|node| { + node.is_rule_with_kind(RuleKind::YulColonAndEqual) + || node.is_token_with_kind(TokenKind::ColonEqual) + }) + } +} + impl Selector { fn yul_switch_case(&mut self) -> Result { self.select(|node| { diff --git a/crates/solidity/outputs/cargo/tests/src/cst_output/generated/YulAssignmentStatement.rs b/crates/solidity/outputs/cargo/tests/src/cst_output/generated/YulAssignmentStatement.rs index c3568b61a4..cb90c3b10d 100644 --- a/crates/solidity/outputs/cargo/tests/src/cst_output/generated/YulAssignmentStatement.rs +++ b/crates/solidity/outputs/cargo/tests/src/cst_output/generated/YulAssignmentStatement.rs @@ -4,6 +4,11 @@ use anyhow::Result; use crate::cst_output::runner::run; +#[test] +fn colon_equal_separated() -> Result<()> { + run("YulAssignmentStatement", "colon_equal_separated") +} + #[test] fn identifier_add() -> Result<()> { run("YulAssignmentStatement", "identifier_add") diff --git a/crates/solidity/outputs/cargo/tests/src/cst_output/generated/YulVariableDeclarationStatement.rs b/crates/solidity/outputs/cargo/tests/src/cst_output/generated/YulVariableDeclarationStatement.rs index 1935707179..c975946a3a 100644 --- a/crates/solidity/outputs/cargo/tests/src/cst_output/generated/YulVariableDeclarationStatement.rs +++ b/crates/solidity/outputs/cargo/tests/src/cst_output/generated/YulVariableDeclarationStatement.rs @@ -4,6 +4,11 @@ use anyhow::Result; use crate::cst_output::runner::run; +#[test] +fn colon_equal_separated() -> Result<()> { + run("YulVariableDeclarationStatement", "colon_equal_separated") +} + #[test] fn keyword_bytes() -> Result<()> { run("YulVariableDeclarationStatement", "keyword_bytes") 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 a661da5651..331fe93095 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 @@ -106,7 +106,7 @@ mod YulLeaveStatement; #[allow(non_snake_case)] mod YulVariableDeclarationStatement; -pub const VERSION_BREAKS: [Version; 27] = [ +pub const VERSION_BREAKS: [Version; 28] = [ Version::new(0, 4, 11), Version::new(0, 4, 12), Version::new(0, 4, 14), @@ -114,6 +114,7 @@ pub const VERSION_BREAKS: [Version; 27] = [ Version::new(0, 4, 22), Version::new(0, 5, 0), Version::new(0, 5, 3), + Version::new(0, 5, 5), Version::new(0, 5, 10), Version::new(0, 5, 12), Version::new(0, 5, 14), 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 ec712b1d8f..3a119a7860 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 @@ -3410,10 +3410,10 @@ export class YulVariableDeclarationStatement { export class YulVariableDeclarationValue { private readonly fetch = once(() => { - const [$colonEqual, $expression] = ast_internal.selectSequence(this.cst); + const [$assignment, $expression] = ast_internal.selectSequence(this.cst); return { - colonEqual: $colonEqual as TokenNode, + assignment: new YulAssignmentOperator($assignment as RuleNode), expression: new YulExpression($expression as RuleNode), }; }); @@ -3422,8 +3422,8 @@ export class YulVariableDeclarationValue { assertKind(this.cst.kind, RuleKind.YulVariableDeclarationValue); } - public get colonEqual(): TokenNode { - return this.fetch().colonEqual; + public get assignment(): YulAssignmentOperator { + return this.fetch().assignment; } public get expression(): YulExpression { @@ -3433,11 +3433,11 @@ export class YulVariableDeclarationValue { export class YulAssignmentStatement { private readonly fetch = once(() => { - const [$names, $colonEqual, $expression] = ast_internal.selectSequence(this.cst); + const [$names, $assignment, $expression] = ast_internal.selectSequence(this.cst); return { names: new YulIdentifierPaths($names as RuleNode), - colonEqual: $colonEqual as TokenNode, + assignment: new YulAssignmentOperator($assignment as RuleNode), expression: new YulExpression($expression as RuleNode), }; }); @@ -3450,8 +3450,8 @@ export class YulAssignmentStatement { return this.fetch().names; } - public get colonEqual(): TokenNode { - return this.fetch().colonEqual; + public get assignment(): YulAssignmentOperator { + return this.fetch().assignment; } public get expression(): YulExpression { @@ -3459,6 +3459,29 @@ export class YulAssignmentStatement { } } +export class YulColonAndEqual { + private readonly fetch = once(() => { + const [$colon, $equal] = ast_internal.selectSequence(this.cst); + + return { + colon: $colon as TokenNode, + equal: $equal as TokenNode, + }; + }); + + public constructor(public readonly cst: RuleNode) { + assertKind(this.cst.kind, RuleKind.YulColonAndEqual); + } + + public get colon(): TokenNode { + return this.fetch().colon; + } + + public get equal(): TokenNode { + return this.fetch().equal; + } +} + export class YulIfStatement { private readonly fetch = once(() => { const [$ifKeyword, $condition, $body] = ast_internal.selectSequence(this.cst); @@ -5066,6 +5089,31 @@ export class YulStatement { } } +export class YulAssignmentOperator { + private readonly fetch: () => YulColonAndEqual | TokenNode = once(() => { + const variant = ast_internal.selectChoice(this.cst); + + switch (variant.kind) { + case RuleKind.YulColonAndEqual: + return new YulColonAndEqual(variant as RuleNode); + + case TokenKind.ColonEqual: + return variant as TokenNode; + + default: + assert.fail(`Unexpected variant: ${variant.kind}`); + } + }); + + public constructor(public readonly cst: RuleNode) { + assertKind(this.cst.kind, RuleKind.YulAssignmentOperator); + } + + public get variant(): YulColonAndEqual | TokenNode { + return this.fetch(); + } +} + export class YulSwitchCase { private readonly fetch: () => YulDefaultCase | YulValueCase = once(() => { const variant = ast_internal.selectChoice(this.cst); diff --git a/crates/solidity/outputs/npm/package/src/generated/index.d.ts b/crates/solidity/outputs/npm/package/src/generated/index.d.ts index b8563ea40d..3cee163176 100644 --- a/crates/solidity/outputs/npm/package/src/generated/index.d.ts +++ b/crates/solidity/outputs/npm/package/src/generated/index.d.ts @@ -196,10 +196,12 @@ export namespace kinds { VersionPragmaSpecifier = "VersionPragmaSpecifier", WhileStatement = "WhileStatement", YulArguments = "YulArguments", + YulAssignmentOperator = "YulAssignmentOperator", YulAssignmentStatement = "YulAssignmentStatement", YulBlock = "YulBlock", YulBreakStatement = "YulBreakStatement", YulBuiltInFunction = "YulBuiltInFunction", + YulColonAndEqual = "YulColonAndEqual", YulContinueStatement = "YulContinueStatement", YulDefaultCase = "YulDefaultCase", YulExpression = "YulExpression", @@ -240,6 +242,7 @@ export namespace kinds { Arguments = "Arguments", AsKeyword = "AsKeyword", AssemblyKeyword = "AssemblyKeyword", + Assignment = "Assignment", Asterisk = "Asterisk", Attributes = "Attributes", Block = "Block", @@ -254,7 +257,6 @@ export namespace kinds { CloseBracket = "CloseBracket", CloseParen = "CloseParen", Colon = "Colon", - ColonEqual = "ColonEqual", Condition = "Condition", ConstantKeyword = "ConstantKeyword", ConstructorKeyword = "ConstructorKeyword", diff --git a/crates/solidity/outputs/spec/generated/grammar.ebnf b/crates/solidity/outputs/spec/generated/grammar.ebnf index 0ae6a187d5..2603854857 100644 --- a/crates/solidity/outputs/spec/generated/grammar.ebnf +++ b/crates/solidity/outputs/spec/generated/grammar.ebnf @@ -1356,13 +1356,20 @@ YulVariableDeclarationStatement = YUL_LET_KEYWORD YulIdentifierPaths YulVariableDeclarationValue?; -YulVariableDeclarationValue = COLON_EQUAL +YulVariableDeclarationValue = YulAssignmentOperator YulExpression; YulAssignmentStatement = YulIdentifierPaths - COLON_EQUAL + YulAssignmentOperator YulExpression; +YulAssignmentOperator = YulColonAndEqual (* Deprecated in 0.5.5 *) + | COLON_EQUAL; + +(* Deprecated in 0.5.5 *) +YulColonAndEqual = COLON + EQUAL; + YulIfStatement = YUL_IF_KEYWORD YulExpression YulBlock; diff --git a/crates/solidity/outputs/spec/generated/public/06-yul/01-yul-statements.md b/crates/solidity/outputs/spec/generated/public/06-yul/01-yul-statements.md index b98fa521e5..c69ad1364a 100644 --- a/crates/solidity/outputs/spec/generated/public/06-yul/01-yul-statements.md +++ b/crates/solidity/outputs/spec/generated/public/06-yul/01-yul-statements.md @@ -62,13 +62,25 @@ ``` -
YulVariableDeclarationValue = COLON_EQUAL
YulExpression;
+
YulVariableDeclarationValue = YulAssignmentOperator
YulExpression;
```{ .ebnf #YulAssignmentStatement } ``` -
YulAssignmentStatement = YulIdentifierPaths
COLON_EQUAL
YulExpression;
+
YulAssignmentStatement = YulIdentifierPaths
YulAssignmentOperator
YulExpression;
+ +```{ .ebnf #YulAssignmentOperator } + +``` + +
YulAssignmentOperator = YulColonAndEqual (* Deprecated in 0.5.5 *)
| COLON_EQUAL;
+ +```{ .ebnf #YulColonAndEqual } + +``` + +
(* Deprecated in 0.5.5 *)
YulColonAndEqual = COLON
EQUAL;
```{ .ebnf #YulIfStatement } diff --git a/crates/solidity/outputs/spec/generated/public/supported-versions.md b/crates/solidity/outputs/spec/generated/public/supported-versions.md index c91ee76d9e..a65dcbc9b5 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, 27 versions have breaking changes: +Among which, 28 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.5.14` `0.6.0` `0.6.2` `0.6.5` `0.6.7` `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.5` `0.5.10` `0.5.12` `0.5.14` `0.6.0` `0.6.2` `0.6.5` `0.6.7` `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/YulAssignmentStatement/colon_equal_separated/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/colon_equal_separated/generated/0.4.11-success.yml new file mode 100644 index 0000000000..a7ab2a3d9a --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/colon_equal_separated/generated/0.4.11-success.yml @@ -0,0 +1,25 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ // ColonEqual was two separate tokens before "0.5.0": │ 0..53 + 2 │ foo : = 0 │ 54..63 + +Errors: [] + +Tree: + - (YulAssignmentStatement): # '// ColonEqual was two separate tokens before "0.5....' (0..64) + - (names꞉ YulIdentifierPaths): # '// ColonEqual was two separate tokens before "0.5....' (0..57) + - (item꞉ YulIdentifierPath): # '// ColonEqual was two separate tokens before "0.5....' (0..57) + - (LeadingTrivia): # '// ColonEqual was two separate tokens before "0.5....' (0..54) + - (SingleLineComment): '// ColonEqual was two separate tokens before "0.5....' # (0..53) + - (EndOfLine): "\n" # (53..54) + - (item꞉ YulIdentifier): "foo" # (54..57) + - (assignment꞉ YulAssignmentOperator) ► (variant꞉ YulColonAndEqual): # " : =" (57..61) + - (LeadingTrivia) ► (Whitespace): " " # (57..58) + - (colon꞉ Colon): ":" # (58..59) + - (LeadingTrivia) ► (Whitespace): " " # (59..60) + - (equal꞉ Equal): "=" # (60..61) + - (expression꞉ YulExpression) ► (variant꞉ YulLiteral): # " 0\n" (61..64) + - (LeadingTrivia) ► (Whitespace): " " # (61..62) + - (variant꞉ YulDecimalLiteral): "0" # (62..63) + - (TrailingTrivia) ► (EndOfLine): "\n" # (63..64) diff --git a/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/colon_equal_separated/generated/0.5.5-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/colon_equal_separated/generated/0.5.5-failure.yml new file mode 100644 index 0000000000..ba5c6be90f --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/colon_equal_separated/generated/0.5.5-failure.yml @@ -0,0 +1,25 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ // ColonEqual was two separate tokens before "0.5.0": │ 0..53 + 2 │ foo : = 0 │ 54..63 + +Errors: # 1 total + - > + Error: Expected ColonEqual or Comma. + ╭─[crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/colon_equal_separated/input.sol:2:4] + │ + 2 │ foo : = 0 + │ ───┬─── + │ ╰───── Error occurred here. + ───╯ + +Tree: + - (YulAssignmentStatement): # '// ColonEqual was two separate tokens before "0.5....' (0..64) + - (names꞉ YulIdentifierPaths): # '// ColonEqual was two separate tokens before "0.5....' (0..57) + - (item꞉ YulIdentifierPath): # '// ColonEqual was two separate tokens before "0.5....' (0..57) + - (LeadingTrivia): # '// ColonEqual was two separate tokens before "0.5....' (0..54) + - (SingleLineComment): '// ColonEqual was two separate tokens before "0.5....' # (0..53) + - (EndOfLine): "\n" # (53..54) + - (item꞉ YulIdentifier): "foo" # (54..57) + - (SKIPPED): " : = 0\n" # (57..64) diff --git a/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/colon_equal_separated/input.sol b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/colon_equal_separated/input.sol new file mode 100644 index 0000000000..7f0547d15f --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/colon_equal_separated/input.sol @@ -0,0 +1,2 @@ +// ColonEqual was two separate tokens before "0.5.0": +foo : = 0 diff --git a/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_basefee/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_basefee/generated/0.4.11-success.yml index 84d9556c65..d6297e2eb7 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_basefee/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_basefee/generated/0.4.11-success.yml @@ -10,8 +10,9 @@ Tree: - (names꞉ YulIdentifierPaths): # "basefee" (0..7) - (item꞉ YulIdentifierPath): # "basefee" (0..7) - (item꞉ YulIdentifier): "basefee" # (0..7) - - (LeadingTrivia) ► (Whitespace): " " # (7..8) - - (colon_equal꞉ ColonEqual): ":=" # (8..10) + - (assignment꞉ YulAssignmentOperator): # " :=" (7..10) + - (LeadingTrivia) ► (Whitespace): " " # (7..8) + - (variant꞉ ColonEqual): ":=" # (8..10) - (expression꞉ YulExpression) ► (variant꞉ YulLiteral): # " 0\n" (10..13) - (LeadingTrivia) ► (Whitespace): " " # (10..11) - (variant꞉ YulDecimalLiteral): "0" # (11..12) diff --git a/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_chainid/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_chainid/generated/0.4.11-success.yml index c0e043da63..2278ffaecd 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_chainid/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_chainid/generated/0.4.11-success.yml @@ -10,8 +10,9 @@ Tree: - (names꞉ YulIdentifierPaths): # "chainid" (0..7) - (item꞉ YulIdentifierPath): # "chainid" (0..7) - (item꞉ YulIdentifier): "chainid" # (0..7) - - (LeadingTrivia) ► (Whitespace): " " # (7..8) - - (colon_equal꞉ ColonEqual): ":=" # (8..10) + - (assignment꞉ YulAssignmentOperator): # " :=" (7..10) + - (LeadingTrivia) ► (Whitespace): " " # (7..8) + - (variant꞉ ColonEqual): ":=" # (8..10) - (expression꞉ YulExpression) ► (variant꞉ YulLiteral): # " 0\n" (10..13) - (LeadingTrivia) ► (Whitespace): " " # (10..11) - (variant꞉ YulDecimalLiteral): "0" # (11..12) diff --git a/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_create2/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_create2/generated/0.4.11-success.yml index ee949d7535..466ca78188 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_create2/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_create2/generated/0.4.11-success.yml @@ -10,8 +10,9 @@ Tree: - (names꞉ YulIdentifierPaths): # "create2" (0..7) - (item꞉ YulIdentifierPath): # "create2" (0..7) - (item꞉ YulIdentifier): "create2" # (0..7) - - (LeadingTrivia) ► (Whitespace): " " # (7..8) - - (colon_equal꞉ ColonEqual): ":=" # (8..10) + - (assignment꞉ YulAssignmentOperator): # " :=" (7..10) + - (LeadingTrivia) ► (Whitespace): " " # (7..8) + - (variant꞉ ColonEqual): ":=" # (8..10) - (expression꞉ YulExpression) ► (variant꞉ YulLiteral): # " 0\n" (10..13) - (LeadingTrivia) ► (Whitespace): " " # (10..11) - (variant꞉ YulDecimalLiteral): "0" # (11..12) diff --git a/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_extcodehash/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_extcodehash/generated/0.4.11-success.yml index 8198ef7e15..74c9bd7807 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_extcodehash/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_extcodehash/generated/0.4.11-success.yml @@ -10,8 +10,9 @@ Tree: - (names꞉ YulIdentifierPaths): # "extcodehash" (0..11) - (item꞉ YulIdentifierPath): # "extcodehash" (0..11) - (item꞉ YulIdentifier): "extcodehash" # (0..11) - - (LeadingTrivia) ► (Whitespace): " " # (11..12) - - (colon_equal꞉ ColonEqual): ":=" # (12..14) + - (assignment꞉ YulAssignmentOperator): # " :=" (11..14) + - (LeadingTrivia) ► (Whitespace): " " # (11..12) + - (variant꞉ ColonEqual): ":=" # (12..14) - (expression꞉ YulExpression) ► (variant꞉ YulLiteral): # " 0\n" (14..17) - (LeadingTrivia) ► (Whitespace): " " # (14..15) - (variant꞉ YulDecimalLiteral): "0" # (15..16) diff --git a/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_keccak256/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_keccak256/generated/0.4.11-success.yml index 085481510b..014490d57f 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_keccak256/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_keccak256/generated/0.4.11-success.yml @@ -10,8 +10,9 @@ Tree: - (names꞉ YulIdentifierPaths): # "keccak256" (0..9) - (item꞉ YulIdentifierPath): # "keccak256" (0..9) - (item꞉ YulIdentifier): "keccak256" # (0..9) - - (LeadingTrivia) ► (Whitespace): " " # (9..10) - - (colon_equal꞉ ColonEqual): ":=" # (10..12) + - (assignment꞉ YulAssignmentOperator): # " :=" (9..12) + - (LeadingTrivia) ► (Whitespace): " " # (9..10) + - (variant꞉ ColonEqual): ":=" # (10..12) - (expression꞉ YulExpression) ► (variant꞉ YulLiteral): # " 0\n" (12..15) - (LeadingTrivia) ► (Whitespace): " " # (12..13) - (variant꞉ YulDecimalLiteral): "0" # (13..14) diff --git a/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_prevrandao/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_prevrandao/generated/0.4.11-success.yml index 7ca3f1124d..6fce9ad3bf 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_prevrandao/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_prevrandao/generated/0.4.11-success.yml @@ -10,8 +10,9 @@ Tree: - (names꞉ YulIdentifierPaths): # "prevrandao" (0..10) - (item꞉ YulIdentifierPath): # "prevrandao" (0..10) - (item꞉ YulIdentifier): "prevrandao" # (0..10) - - (LeadingTrivia) ► (Whitespace): " " # (10..11) - - (colon_equal꞉ ColonEqual): ":=" # (11..13) + - (assignment꞉ YulAssignmentOperator): # " :=" (10..13) + - (LeadingTrivia) ► (Whitespace): " " # (10..11) + - (variant꞉ ColonEqual): ":=" # (11..13) - (expression꞉ YulExpression) ► (variant꞉ YulLiteral): # " 0\n" (13..16) - (LeadingTrivia) ► (Whitespace): " " # (13..14) - (variant꞉ YulDecimalLiteral): "0" # (14..15) diff --git a/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_returndatacopy/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_returndatacopy/generated/0.4.11-success.yml index 387f5c8c1e..b3c1153ad8 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_returndatacopy/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_returndatacopy/generated/0.4.11-success.yml @@ -10,8 +10,9 @@ Tree: - (names꞉ YulIdentifierPaths): # "returndatacopy" (0..14) - (item꞉ YulIdentifierPath): # "returndatacopy" (0..14) - (item꞉ YulIdentifier): "returndatacopy" # (0..14) - - (LeadingTrivia) ► (Whitespace): " " # (14..15) - - (colon_equal꞉ ColonEqual): ":=" # (15..17) + - (assignment꞉ YulAssignmentOperator): # " :=" (14..17) + - (LeadingTrivia) ► (Whitespace): " " # (14..15) + - (variant꞉ ColonEqual): ":=" # (15..17) - (expression꞉ YulExpression) ► (variant꞉ YulLiteral): # " 0\n" (17..20) - (LeadingTrivia) ► (Whitespace): " " # (17..18) - (variant꞉ YulDecimalLiteral): "0" # (18..19) diff --git a/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_returndatasize/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_returndatasize/generated/0.4.11-success.yml index dee4123102..a0aec248a5 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_returndatasize/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_returndatasize/generated/0.4.11-success.yml @@ -10,8 +10,9 @@ Tree: - (names꞉ YulIdentifierPaths): # "returndatasize" (0..14) - (item꞉ YulIdentifierPath): # "returndatasize" (0..14) - (item꞉ YulIdentifier): "returndatasize" # (0..14) - - (LeadingTrivia) ► (Whitespace): " " # (14..15) - - (colon_equal꞉ ColonEqual): ":=" # (15..17) + - (assignment꞉ YulAssignmentOperator): # " :=" (14..17) + - (LeadingTrivia) ► (Whitespace): " " # (14..15) + - (variant꞉ ColonEqual): ":=" # (15..17) - (expression꞉ YulExpression) ► (variant꞉ YulLiteral): # " 0\n" (17..20) - (LeadingTrivia) ► (Whitespace): " " # (17..18) - (variant꞉ YulDecimalLiteral): "0" # (18..19) diff --git a/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_sar/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_sar/generated/0.4.11-success.yml index 164a53f70a..bfd04d0b49 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_sar/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_sar/generated/0.4.11-success.yml @@ -10,8 +10,9 @@ Tree: - (names꞉ YulIdentifierPaths): # "sar" (0..3) - (item꞉ YulIdentifierPath): # "sar" (0..3) - (item꞉ YulIdentifier): "sar" # (0..3) - - (LeadingTrivia) ► (Whitespace): " " # (3..4) - - (colon_equal꞉ ColonEqual): ":=" # (4..6) + - (assignment꞉ YulAssignmentOperator): # " :=" (3..6) + - (LeadingTrivia) ► (Whitespace): " " # (3..4) + - (variant꞉ ColonEqual): ":=" # (4..6) - (expression꞉ YulExpression) ► (variant꞉ YulLiteral): # " 0\n" (6..9) - (LeadingTrivia) ► (Whitespace): " " # (6..7) - (variant꞉ YulDecimalLiteral): "0" # (7..8) diff --git a/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_selfbalance/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_selfbalance/generated/0.4.11-success.yml index f862efdcad..c69ac3ec1d 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_selfbalance/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_selfbalance/generated/0.4.11-success.yml @@ -10,8 +10,9 @@ Tree: - (names꞉ YulIdentifierPaths): # "selfbalance" (0..11) - (item꞉ YulIdentifierPath): # "selfbalance" (0..11) - (item꞉ YulIdentifier): "selfbalance" # (0..11) - - (LeadingTrivia) ► (Whitespace): " " # (11..12) - - (colon_equal꞉ ColonEqual): ":=" # (12..14) + - (assignment꞉ YulAssignmentOperator): # " :=" (11..14) + - (LeadingTrivia) ► (Whitespace): " " # (11..12) + - (variant꞉ ColonEqual): ":=" # (12..14) - (expression꞉ YulExpression) ► (variant꞉ YulLiteral): # " 0\n" (14..17) - (LeadingTrivia) ► (Whitespace): " " # (14..15) - (variant꞉ YulDecimalLiteral): "0" # (15..16) diff --git a/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_sha3/generated/0.5.0-success.yml b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_sha3/generated/0.5.0-success.yml index 267a700766..f0c5e3b202 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_sha3/generated/0.5.0-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_sha3/generated/0.5.0-success.yml @@ -10,8 +10,9 @@ Tree: - (names꞉ YulIdentifierPaths): # "sha3" (0..4) - (item꞉ YulIdentifierPath): # "sha3" (0..4) - (item꞉ YulIdentifier): "sha3" # (0..4) - - (LeadingTrivia) ► (Whitespace): " " # (4..5) - - (colon_equal꞉ ColonEqual): ":=" # (5..7) + - (assignment꞉ YulAssignmentOperator): # " :=" (4..7) + - (LeadingTrivia) ► (Whitespace): " " # (4..5) + - (variant꞉ ColonEqual): ":=" # (5..7) - (expression꞉ YulExpression) ► (variant꞉ YulLiteral): # " 0\n" (7..10) - (LeadingTrivia) ► (Whitespace): " " # (7..8) - (variant꞉ YulDecimalLiteral): "0" # (8..9) diff --git a/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_shl/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_shl/generated/0.4.11-success.yml index 28ad0f46db..5264718256 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_shl/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_shl/generated/0.4.11-success.yml @@ -10,8 +10,9 @@ Tree: - (names꞉ YulIdentifierPaths): # "shl" (0..3) - (item꞉ YulIdentifierPath): # "shl" (0..3) - (item꞉ YulIdentifier): "shl" # (0..3) - - (LeadingTrivia) ► (Whitespace): " " # (3..4) - - (colon_equal꞉ ColonEqual): ":=" # (4..6) + - (assignment꞉ YulAssignmentOperator): # " :=" (3..6) + - (LeadingTrivia) ► (Whitespace): " " # (3..4) + - (variant꞉ ColonEqual): ":=" # (4..6) - (expression꞉ YulExpression) ► (variant꞉ YulLiteral): # " 0\n" (6..9) - (LeadingTrivia) ► (Whitespace): " " # (6..7) - (variant꞉ YulDecimalLiteral): "0" # (7..8) diff --git a/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_shr/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_shr/generated/0.4.11-success.yml index f9a9da361e..6368e97f39 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_shr/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_shr/generated/0.4.11-success.yml @@ -10,8 +10,9 @@ Tree: - (names꞉ YulIdentifierPaths): # "shr" (0..3) - (item꞉ YulIdentifierPath): # "shr" (0..3) - (item꞉ YulIdentifier): "shr" # (0..3) - - (LeadingTrivia) ► (Whitespace): " " # (3..4) - - (colon_equal꞉ ColonEqual): ":=" # (4..6) + - (assignment꞉ YulAssignmentOperator): # " :=" (3..6) + - (LeadingTrivia) ► (Whitespace): " " # (3..4) + - (variant꞉ ColonEqual): ":=" # (4..6) - (expression꞉ YulExpression) ► (variant꞉ YulLiteral): # " 0\n" (6..9) - (LeadingTrivia) ► (Whitespace): " " # (6..7) - (variant꞉ YulDecimalLiteral): "0" # (7..8) diff --git a/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_staticcall/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_staticcall/generated/0.4.11-success.yml index d2d4788e9b..4ac0609138 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_staticcall/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_staticcall/generated/0.4.11-success.yml @@ -10,8 +10,9 @@ Tree: - (names꞉ YulIdentifierPaths): # "staticcall" (0..10) - (item꞉ YulIdentifierPath): # "staticcall" (0..10) - (item꞉ YulIdentifier): "staticcall" # (0..10) - - (LeadingTrivia) ► (Whitespace): " " # (10..11) - - (colon_equal꞉ ColonEqual): ":=" # (11..13) + - (assignment꞉ YulAssignmentOperator): # " :=" (10..13) + - (LeadingTrivia) ► (Whitespace): " " # (10..11) + - (variant꞉ ColonEqual): ":=" # (11..13) - (expression꞉ YulExpression) ► (variant꞉ YulLiteral): # " 0\n" (13..16) - (LeadingTrivia) ► (Whitespace): " " # (13..14) - (variant꞉ YulDecimalLiteral): "0" # (14..15) diff --git a/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_suicide/generated/0.5.0-success.yml b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_suicide/generated/0.5.0-success.yml index ea4f61108f..f7713b4bee 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_suicide/generated/0.5.0-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulAssignmentStatement/identifier_suicide/generated/0.5.0-success.yml @@ -10,8 +10,9 @@ Tree: - (names꞉ YulIdentifierPaths): # "suicide" (0..7) - (item꞉ YulIdentifierPath): # "suicide" (0..7) - (item꞉ YulIdentifier): "suicide" # (0..7) - - (LeadingTrivia) ► (Whitespace): " " # (7..8) - - (colon_equal꞉ ColonEqual): ":=" # (8..10) + - (assignment꞉ YulAssignmentOperator): # " :=" (7..10) + - (LeadingTrivia) ► (Whitespace): " " # (7..8) + - (variant꞉ ColonEqual): ":=" # (8..10) - (expression꞉ YulExpression) ► (variant꞉ YulLiteral): # " 0\n" (10..13) - (LeadingTrivia) ► (Whitespace): " " # (10..11) - (variant꞉ YulDecimalLiteral): "0" # (11..12) diff --git a/crates/solidity/testing/snapshots/cst_output/YulBlock/function_def/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/YulBlock/function_def/generated/0.4.11-success.yml index fe1f2beaf0..66ecb3e5af 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulBlock/function_def/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulBlock/function_def/generated/0.4.11-success.yml @@ -43,8 +43,9 @@ Tree: - (item꞉ YulIdentifierPath): # "\t\tresult" (35..43) - (LeadingTrivia) ► (Whitespace): "\t\t" # (35..37) - (item꞉ YulIdentifier): "result" # (37..43) - - (LeadingTrivia) ► (Whitespace): " " # (43..44) - - (colon_equal꞉ ColonEqual): ":=" # (44..46) + - (assignment꞉ YulAssignmentOperator): # " :=" (43..46) + - (LeadingTrivia) ► (Whitespace): " " # (43..44) + - (variant꞉ ColonEqual): ":=" # (44..46) - (expression꞉ YulExpression) ► (variant꞉ YulFunctionCallExpression): # " mul(a, b)\n" (46..57) - (operand꞉ YulExpression) ► (variant꞉ YulBuiltInFunction): # " mul" (46..50) - (LeadingTrivia) ► (Whitespace): " " # (46..47) diff --git a/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.4.11-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.4.11-failure.yml index f948a02a0e..ffe63c89c3 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.4.11-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.4.11-failure.yml @@ -53,8 +53,9 @@ Tree: - (item꞉ YulIdentifierPath): # "\t\tresult" (35..43) - (LeadingTrivia) ► (Whitespace): "\t\t" # (35..37) - (item꞉ YulIdentifier): "result" # (37..43) - - (LeadingTrivia) ► (Whitespace): " " # (43..44) - - (colon_equal꞉ ColonEqual): ":=" # (44..46) + - (assignment꞉ YulAssignmentOperator): # " :=" (43..46) + - (LeadingTrivia) ► (Whitespace): " " # (43..44) + - (variant꞉ ColonEqual): ":=" # (44..46) - (expression꞉ YulExpression) ► (variant꞉ YulFunctionCallExpression): # " mul(a, b)\n" (46..57) - (operand꞉ YulExpression) ► (variant꞉ YulBuiltInFunction): # " mul" (46..50) - (LeadingTrivia) ► (Whitespace): " " # (46..47) diff --git a/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.4.12-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.4.12-failure.yml index eb38c041e8..420d5efcaa 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.4.12-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.4.12-failure.yml @@ -53,8 +53,9 @@ Tree: - (item꞉ YulIdentifierPath): # "\t\tresult" (35..43) - (LeadingTrivia) ► (Whitespace): "\t\t" # (35..37) - (item꞉ YulIdentifier): "result" # (37..43) - - (LeadingTrivia) ► (Whitespace): " " # (43..44) - - (colon_equal꞉ ColonEqual): ":=" # (44..46) + - (assignment꞉ YulAssignmentOperator): # " :=" (43..46) + - (LeadingTrivia) ► (Whitespace): " " # (43..44) + - (variant꞉ ColonEqual): ":=" # (44..46) - (expression꞉ YulExpression) ► (variant꞉ YulFunctionCallExpression): # " mul(a, b)\n" (46..57) - (operand꞉ YulExpression) ► (variant꞉ YulBuiltInFunction): # " mul" (46..50) - (LeadingTrivia) ► (Whitespace): " " # (46..47) diff --git a/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.5.0-failure.yml index a5cf15f25f..7478412d8e 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.5.0-failure.yml @@ -53,8 +53,9 @@ Tree: - (item꞉ YulIdentifierPath): # "\t\tresult" (35..43) - (LeadingTrivia) ► (Whitespace): "\t\t" # (35..37) - (item꞉ YulIdentifier): "result" # (37..43) - - (LeadingTrivia) ► (Whitespace): " " # (43..44) - - (colon_equal꞉ ColonEqual): ":=" # (44..46) + - (assignment꞉ YulAssignmentOperator): # " :=" (43..46) + - (LeadingTrivia) ► (Whitespace): " " # (43..44) + - (variant꞉ ColonEqual): ":=" # (44..46) - (expression꞉ YulExpression) ► (variant꞉ YulFunctionCallExpression): # " mul(a, b)\n" (46..57) - (operand꞉ YulExpression) ► (variant꞉ YulBuiltInFunction): # " mul" (46..50) - (LeadingTrivia) ► (Whitespace): " " # (46..47) diff --git a/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.6.0-failure.yml index 1f6aca0ab2..0a2f992b8a 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.6.0-failure.yml @@ -53,8 +53,9 @@ Tree: - (item꞉ YulIdentifierPath): # "\t\tresult" (35..43) - (LeadingTrivia) ► (Whitespace): "\t\t" # (35..37) - (item꞉ YulIdentifier): "result" # (37..43) - - (LeadingTrivia) ► (Whitespace): " " # (43..44) - - (colon_equal꞉ ColonEqual): ":=" # (44..46) + - (assignment꞉ YulAssignmentOperator): # " :=" (43..46) + - (LeadingTrivia) ► (Whitespace): " " # (43..44) + - (variant꞉ ColonEqual): ":=" # (44..46) - (expression꞉ YulExpression) ► (variant꞉ YulFunctionCallExpression): # " mul(a, b)\n" (46..57) - (operand꞉ YulExpression) ► (variant꞉ YulBuiltInFunction): # " mul" (46..50) - (LeadingTrivia) ► (Whitespace): " " # (46..47) diff --git a/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.8.18-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.8.18-failure.yml index 712b0e8177..760a79cbc9 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.8.18-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.8.18-failure.yml @@ -53,8 +53,9 @@ Tree: - (item꞉ YulIdentifierPath): # "\t\tresult" (35..43) - (LeadingTrivia) ► (Whitespace): "\t\t" # (35..37) - (item꞉ YulIdentifier): "result" # (37..43) - - (LeadingTrivia) ► (Whitespace): " " # (43..44) - - (colon_equal꞉ ColonEqual): ":=" # (44..46) + - (assignment꞉ YulAssignmentOperator): # " :=" (43..46) + - (LeadingTrivia) ► (Whitespace): " " # (43..44) + - (variant꞉ ColonEqual): ":=" # (44..46) - (expression꞉ YulExpression) ► (variant꞉ YulFunctionCallExpression): # " mul(a, b)\n" (46..57) - (operand꞉ YulExpression) ► (variant꞉ YulBuiltInFunction): # " mul" (46..50) - (LeadingTrivia) ► (Whitespace): " " # (46..47) diff --git a/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.8.7-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.8.7-failure.yml index 91f64a1add..f8befdbee4 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.8.7-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/generated/0.8.7-failure.yml @@ -53,8 +53,9 @@ Tree: - (item꞉ YulIdentifierPath): # "\t\tresult" (35..43) - (LeadingTrivia) ► (Whitespace): "\t\t" # (35..37) - (item꞉ YulIdentifier): "result" # (37..43) - - (LeadingTrivia) ► (Whitespace): " " # (43..44) - - (colon_equal꞉ ColonEqual): ":=" # (44..46) + - (assignment꞉ YulAssignmentOperator): # " :=" (43..46) + - (LeadingTrivia) ► (Whitespace): " " # (43..44) + - (variant꞉ ColonEqual): ":=" # (44..46) - (expression꞉ YulExpression) ► (variant꞉ YulFunctionCallExpression): # " mul(a, b)\n" (46..57) - (operand꞉ YulExpression) ► (variant꞉ YulBuiltInFunction): # " mul" (46..50) - (LeadingTrivia) ► (Whitespace): " " # (46..47) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableDeclarationStatement/colon_equal_separated/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableDeclarationStatement/colon_equal_separated/generated/0.4.11-success.yml new file mode 100644 index 0000000000..7d54116f6f --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableDeclarationStatement/colon_equal_separated/generated/0.4.11-success.yml @@ -0,0 +1,28 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ // ColonEqual was two separate tokens before "0.5.0": │ 0..53 + 2 │ let foo : = 0 │ 54..67 + +Errors: [] + +Tree: + - (YulVariableDeclarationStatement): # '// ColonEqual was two separate tokens before "0.5....' (0..68) + - (LeadingTrivia): # '// ColonEqual was two separate tokens before "0.5....' (0..54) + - (SingleLineComment): '// ColonEqual was two separate tokens before "0.5....' # (0..53) + - (EndOfLine): "\n" # (53..54) + - (let_keyword꞉ YulLetKeyword): "let" # (54..57) + - (names꞉ YulIdentifierPaths): # " foo" (57..61) + - (item꞉ YulIdentifierPath): # " foo" (57..61) + - (LeadingTrivia) ► (Whitespace): " " # (57..58) + - (item꞉ YulIdentifier): "foo" # (58..61) + - (value꞉ YulVariableDeclarationValue): # " : = 0\n" (61..68) + - (assignment꞉ YulAssignmentOperator) ► (variant꞉ YulColonAndEqual): # " : =" (61..65) + - (LeadingTrivia) ► (Whitespace): " " # (61..62) + - (colon꞉ Colon): ":" # (62..63) + - (LeadingTrivia) ► (Whitespace): " " # (63..64) + - (equal꞉ Equal): "=" # (64..65) + - (expression꞉ YulExpression) ► (variant꞉ YulLiteral): # " 0\n" (65..68) + - (LeadingTrivia) ► (Whitespace): " " # (65..66) + - (variant꞉ YulDecimalLiteral): "0" # (66..67) + - (TrailingTrivia) ► (EndOfLine): "\n" # (67..68) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableDeclarationStatement/colon_equal_separated/generated/0.5.5-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableDeclarationStatement/colon_equal_separated/generated/0.5.5-failure.yml new file mode 100644 index 0000000000..3ac2b50f10 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableDeclarationStatement/colon_equal_separated/generated/0.5.5-failure.yml @@ -0,0 +1,28 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ // ColonEqual was two separate tokens before "0.5.0": │ 0..53 + 2 │ let foo : = 0 │ 54..67 + +Errors: # 1 total + - > + Error: Expected ColonEqual. + ╭─[crates/solidity/testing/snapshots/cst_output/YulVariableDeclarationStatement/colon_equal_separated/input.sol:2:9] + │ + 2 │ let foo : = 0 + │ ───┬── + │ ╰──── Error occurred here. + ───╯ + +Tree: + - (YulVariableDeclarationStatement): # '// ColonEqual was two separate tokens before "0.5....' (0..68) + - (LeadingTrivia): # '// ColonEqual was two separate tokens before "0.5....' (0..54) + - (SingleLineComment): '// ColonEqual was two separate tokens before "0.5....' # (0..53) + - (EndOfLine): "\n" # (53..54) + - (let_keyword꞉ YulLetKeyword): "let" # (54..57) + - (names꞉ YulIdentifierPaths): # " foo" (57..61) + - (item꞉ YulIdentifierPath): # " foo" (57..61) + - (LeadingTrivia) ► (Whitespace): " " # (57..58) + - (item꞉ YulIdentifier): "foo" # (58..61) + - (LeadingTrivia) ► (Whitespace): " " # (61..62) + - (SKIPPED): ": = 0\n" # (62..68) diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableDeclarationStatement/colon_equal_separated/input.sol b/crates/solidity/testing/snapshots/cst_output/YulVariableDeclarationStatement/colon_equal_separated/input.sol new file mode 100644 index 0000000000..7d06f83da7 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableDeclarationStatement/colon_equal_separated/input.sol @@ -0,0 +1,2 @@ +// ColonEqual was two separate tokens before "0.5.0": +let foo : = 0