From add0bf1926989704df8411c9ab14951b08ed35e1 Mon Sep 17 00:00:00 2001 From: OmarTawfik <15987992+OmarTawfik@users.noreply.github.com> Date: Sat, 3 Aug 2024 20:49:12 -0700 Subject: [PATCH] fix Yul stack assignments operator This statement uses `=:` and `= :` operators, with no LHS. --- .changeset/itchy-candles-remain.md | 5 ++ .../inputs/language/src/definition.rs | 36 ++++++-- .../src/generated/kinds/generated/mod.rs | 6 +- .../src/generated/language/generated/mod.rs | 80 +++++++++++++++-- .../napi_interface/generated/ast_selectors.rs | 20 ++++- .../yul_stack_assignment_statement.rs | 5 ++ .../src/generated/ast/generated/ast_types.ts | 85 +++++++++++++++---- .../napi-bindings/generated/index.d.ts | 6 +- .../outputs/spec/generated/grammar.ebnf | 25 ++++-- .../01-file-structure/09-punctuation.md | 6 ++ .../public/06-yul/01-yul-statements.md | 22 +++-- .../generated/0.4.11-failure.yml | 2 +- .../generated/0.4.12-failure.yml | 2 +- .../generated/0.4.11-success.yml | 52 +++++------- .../generated/0.5.0-failure.yml | 14 +-- .../generated/0.6.0-failure.yml | 14 +-- .../generated/0.8.10-failure.yml | 14 +-- .../generated/0.8.18-failure.yml | 14 +-- .../generated/0.8.24-failure.yml | 14 +-- .../generated/0.8.7-failure.yml | 14 +-- .../multiple_stack_assignments/input.sol | 6 +- .../generated/0.4.11-success.yml | 16 ++++ .../generated/0.5.0-failure.yml | 17 ++++ .../equal_colon_separated/input.sol | 1 + .../generated/0.4.11-success.yml | 14 ++- .../generated/0.5.0-failure.yml | 6 +- .../single_variable/input.sol | 2 +- .../generated/0.4.11-success.yml | 2 +- .../generated/0.4.11-success.yml | 2 +- 29 files changed, 361 insertions(+), 141 deletions(-) create mode 100644 .changeset/itchy-candles-remain.md create mode 100644 crates/solidity/testing/snapshots/cst_output/YulStackAssignmentStatement/equal_colon_separated/generated/0.4.11-success.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/YulStackAssignmentStatement/equal_colon_separated/generated/0.5.0-failure.yml create mode 100644 crates/solidity/testing/snapshots/cst_output/YulStackAssignmentStatement/equal_colon_separated/input.sol diff --git a/.changeset/itchy-candles-remain.md b/.changeset/itchy-candles-remain.md new file mode 100644 index 0000000000..ea77cc2867 --- /dev/null +++ b/.changeset/itchy-candles-remain.md @@ -0,0 +1,5 @@ +--- +"@nomicfoundation/slang": patch +--- + +fix stack assignments operator `=:`. diff --git a/crates/solidity/inputs/language/src/definition.rs b/crates/solidity/inputs/language/src/definition.rs index 9028c8fd4f..1d2386d9a2 100644 --- a/crates/solidity/inputs/language/src/definition.rs +++ b/crates/solidity/inputs/language/src/definition.rs @@ -1906,6 +1906,13 @@ codegen_language_macros::compile!(Language( name = Equal, definitions = [TokenDefinition(scanner = Atom("="))] ), + Token( + name = EqualColon, + definitions = [TokenDefinition( + enabled = Till("0.5.0"), + scanner = Atom("=:") + )] + ), Token( name = EqualEqual, definitions = [TokenDefinition(scanner = Atom("=="))] @@ -4235,25 +4242,38 @@ codegen_language_macros::compile!(Language( 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 = YulStackAssignmentStatement, enabled = Till("0.5.0"), fields = ( - assignment = Required(YulAssignmentOperator), - expression = Required(YulExpression) + assignment = Required(YulStackAssignmentOperator), + variable = Required(YulIdentifier) ) ), Enum( - name = YulAssignmentOperator, + name = YulStackAssignmentOperator, + enabled = Till("0.5.0"), variants = [ - EnumVariant(reference = YulColonEqual, enabled = Till("0.5.5")), - EnumVariant(reference = ColonEqual) + EnumVariant(reference = YulEqualAndColon), + EnumVariant(reference = EqualColon) ] ), Struct( - name = YulColonEqual, - enabled = Till("0.5.5"), - fields = (colon = Required(Colon), equal = Required(Equal)) + name = YulEqualAndColon, + enabled = Till("0.5.0"), + fields = (equal = Required(Equal), colon = Required(Colon)) ), Struct( name = YulIfStatement, diff --git a/crates/solidity/outputs/cargo/slang_solidity/src/generated/kinds/generated/mod.rs b/crates/solidity/outputs/cargo/slang_solidity/src/generated/kinds/generated/mod.rs index 1608715d27..910ed154a2 100644 --- a/crates/solidity/outputs/cargo/slang_solidity/src/generated/kinds/generated/mod.rs +++ b/crates/solidity/outputs/cargo/slang_solidity/src/generated/kinds/generated/mod.rs @@ -205,9 +205,10 @@ pub enum NonterminalKind { YulBlock, YulBreakStatement, YulBuiltInFunction, - YulColonEqual, + YulColonAndEqual, YulContinueStatement, YulDefaultCase, + YulEqualAndColon, YulExpression, YulForStatement, YulFunctionCallExpression, @@ -222,6 +223,7 @@ pub enum NonterminalKind { YulPathComponent, YulPaths, YulReturnsDeclaration, + YulStackAssignmentOperator, YulStackAssignmentStatement, YulStatement, YulStatements, @@ -383,6 +385,7 @@ pub enum EdgeLabel { Value, ValueType, VarKeyword, + Variable, VariableType, Variables, Version, @@ -468,6 +471,7 @@ pub enum TerminalKind { EndOfLine, EnumKeyword, Equal, + EqualColon, EqualEqual, EqualGreaterThan, ErrorKeyword, diff --git a/crates/solidity/outputs/cargo/slang_solidity/src/generated/language/generated/mod.rs b/crates/solidity/outputs/cargo/slang_solidity/src/generated/language/generated/mod.rs index 2ea359954f..a9d45e2ed1 100644 --- a/crates/solidity/outputs/cargo/slang_solidity/src/generated/language/generated/mod.rs +++ b/crates/solidity/outputs/cargo/slang_solidity/src/generated/language/generated/mod.rs @@ -5864,7 +5864,7 @@ impl Language { 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_equal(input); + let result = self.yul_colon_and_equal(input); choice.consider(input, result)?; } let result = self.parse_terminal_with_trivia::( @@ -6369,7 +6369,7 @@ impl Language { } #[allow(unused_assignments, unused_parens)] - fn yul_colon_equal(&self, input: &mut ParserContext<'_>) -> ParserResult { + 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_labeled( @@ -6391,7 +6391,7 @@ impl Language { } else { ParserResult::disabled() } - .with_kind(NonterminalKind::YulColonEqual) + .with_kind(NonterminalKind::YulColonAndEqual) } #[allow(unused_assignments, unused_parens)] @@ -6420,6 +6420,32 @@ impl Language { .with_kind(NonterminalKind::YulDefaultCase) } + #[allow(unused_assignments, unused_parens)] + fn yul_equal_and_colon(&self, input: &mut ParserContext<'_>) -> ParserResult { + if !self.version_is_at_least_0_5_0 { + SequenceHelper::run(|mut seq| { + seq.elem_labeled( + EdgeLabel::Equal, + self.parse_terminal_with_trivia::( + input, + TerminalKind::Equal, + ), + )?; + seq.elem_labeled( + EdgeLabel::Colon, + self.parse_terminal_with_trivia::( + input, + TerminalKind::Colon, + ), + )?; + seq.finish() + }) + } else { + ParserResult::disabled() + } + .with_kind(NonterminalKind::YulEqualAndColon) + } + #[allow(unused_assignments, unused_parens)] fn yul_expression(&self, input: &mut ParserContext<'_>) -> ParserResult { let parse_postfix_yul_function_call_expression = |input: &mut ParserContext<'_>| { @@ -6766,12 +6792,41 @@ impl Language { .with_kind(NonterminalKind::YulReturnsDeclaration) } + #[allow(unused_assignments, unused_parens)] + fn yul_stack_assignment_operator(&self, input: &mut ParserContext<'_>) -> ParserResult { + if !self.version_is_at_least_0_5_0 { + ChoiceHelper::run(input, |mut choice, input| { + let result = self.yul_equal_and_colon(input); + choice.consider(input, result)?; + let result = self.parse_terminal_with_trivia::( + input, + TerminalKind::EqualColon, + ); + choice.consider(input, result)?; + choice.finish(input) + }) + .with_label(EdgeLabel::Variant) + } else { + ParserResult::disabled() + } + .with_kind(NonterminalKind::YulStackAssignmentOperator) + } + #[allow(unused_assignments, unused_parens)] fn yul_stack_assignment_statement(&self, input: &mut ParserContext<'_>) -> ParserResult { if !self.version_is_at_least_0_5_0 { SequenceHelper::run(|mut seq| { - seq.elem_labeled(EdgeLabel::Assignment, self.yul_assignment_operator(input))?; - seq.elem_labeled(EdgeLabel::Expression, self.yul_expression(input))?; + seq.elem_labeled( + EdgeLabel::Assignment, + self.yul_stack_assignment_operator(input), + )?; + seq.elem_labeled( + EdgeLabel::Variable, + self.parse_terminal_with_trivia::( + input, + TerminalKind::YulIdentifier, + ), + )?; seq.finish() }) } else { @@ -9463,11 +9518,12 @@ impl Language { NonterminalKind::YulBlock => Self::yul_block.parse(self, input), NonterminalKind::YulBreakStatement => Self::yul_break_statement.parse(self, input), NonterminalKind::YulBuiltInFunction => Self::yul_built_in_function.parse(self, input), - NonterminalKind::YulColonEqual => Self::yul_colon_equal.parse(self, input), + NonterminalKind::YulColonAndEqual => Self::yul_colon_and_equal.parse(self, input), NonterminalKind::YulContinueStatement => { Self::yul_continue_statement.parse(self, input) } NonterminalKind::YulDefaultCase => Self::yul_default_case.parse(self, input), + NonterminalKind::YulEqualAndColon => Self::yul_equal_and_colon.parse(self, input), NonterminalKind::YulExpression => Self::yul_expression.parse(self, input), NonterminalKind::YulForStatement => Self::yul_for_statement.parse(self, input), NonterminalKind::YulFunctionCallExpression => { @@ -9490,6 +9546,9 @@ impl Language { NonterminalKind::YulReturnsDeclaration => { Self::yul_returns_declaration.parse(self, input) } + NonterminalKind::YulStackAssignmentOperator => { + Self::yul_stack_assignment_operator.parse(self, input) + } NonterminalKind::YulStackAssignmentStatement => { Self::yul_stack_assignment_statement.parse(self, input) } @@ -11092,7 +11151,14 @@ impl Lexer for Language { } None => Some(TerminalKind::Colon), }, - Some('=') => Some(TerminalKind::Equal), + Some('=') => match input.next() { + Some(':') => Some(TerminalKind::EqualColon), + Some(_) => { + input.undo(); + Some(TerminalKind::Equal) + } + None => Some(TerminalKind::Equal), + }, Some('{') => Some(TerminalKind::OpenBrace), Some('}') => Some(TerminalKind::CloseBrace), Some(_) => { diff --git a/crates/solidity/outputs/cargo/slang_solidity/src/generated/napi_interface/generated/ast_selectors.rs b/crates/solidity/outputs/cargo/slang_solidity/src/generated/napi_interface/generated/ast_selectors.rs index c4c753cc45..042540c9cd 100644 --- a/crates/solidity/outputs/cargo/slang_solidity/src/generated/napi_interface/generated/ast_selectors.rs +++ b/crates/solidity/outputs/cargo/slang_solidity/src/generated/napi_interface/generated/ast_selectors.rs @@ -192,10 +192,11 @@ pub fn select_sequence( NonterminalKind::YulVariableAssignmentStatement => { selector.yul_variable_assignment_statement_sequence()? } + NonterminalKind::YulColonAndEqual => selector.yul_colon_and_equal_sequence()?, NonterminalKind::YulStackAssignmentStatement => { selector.yul_stack_assignment_statement_sequence()? } - NonterminalKind::YulColonEqual => selector.yul_colon_equal_sequence()?, + NonterminalKind::YulEqualAndColon => selector.yul_equal_and_colon_sequence()?, NonterminalKind::YulIfStatement => selector.yul_if_statement_sequence()?, NonterminalKind::YulForStatement => selector.yul_for_statement_sequence()?, NonterminalKind::YulSwitchStatement => selector.yul_switch_statement_sequence()?, @@ -1629,24 +1630,35 @@ impl Selector { } } +impl Selector { + fn yul_colon_and_equal_sequence( + &mut self, + ) -> Result>>> { + Ok(vec![ + Some(self.select(EdgeLabel::Colon)?), + Some(self.select(EdgeLabel::Equal)?), + ]) + } +} + impl Selector { fn yul_stack_assignment_statement_sequence( &mut self, ) -> Result>>> { Ok(vec![ Some(self.select(EdgeLabel::Assignment)?), - Some(self.select(EdgeLabel::Expression)?), + Some(self.select(EdgeLabel::Variable)?), ]) } } impl Selector { - fn yul_colon_equal_sequence( + fn yul_equal_and_colon_sequence( &mut self, ) -> Result>>> { Ok(vec![ - Some(self.select(EdgeLabel::Colon)?), Some(self.select(EdgeLabel::Equal)?), + Some(self.select(EdgeLabel::Colon)?), ]) } } diff --git a/crates/solidity/outputs/cargo/tests/src/cst_output/generated/yul_stack_assignment_statement.rs b/crates/solidity/outputs/cargo/tests/src/cst_output/generated/yul_stack_assignment_statement.rs index 0d796f4e13..fb1addea0d 100644 --- a/crates/solidity/outputs/cargo/tests/src/cst_output/generated/yul_stack_assignment_statement.rs +++ b/crates/solidity/outputs/cargo/tests/src/cst_output/generated/yul_stack_assignment_statement.rs @@ -4,6 +4,11 @@ use anyhow::Result; use crate::cst_output::runner::run; +#[test] +fn equal_colon_separated() -> Result<()> { + run("YulStackAssignmentStatement", "equal_colon_separated") +} + #[test] fn single_variable() -> Result<()> { run("YulStackAssignmentStatement", "single_variable") diff --git a/crates/solidity/outputs/npm/package/src/generated/ast/generated/ast_types.ts b/crates/solidity/outputs/npm/package/src/generated/ast/generated/ast_types.ts index c7e41f7362..d63728090b 100644 --- a/crates/solidity/outputs/npm/package/src/generated/ast/generated/ast_types.ts +++ b/crates/solidity/outputs/npm/package/src/generated/ast/generated/ast_types.ts @@ -3431,13 +3431,36 @@ export class YulVariableAssignmentStatement { } } +export class YulColonAndEqual { + private readonly fetch = once(() => { + const [$colon, $equal] = ast_internal.selectSequence(this.cst); + + return { + colon: $colon as TerminalNode, + equal: $equal as TerminalNode, + }; + }); + + public constructor(public readonly cst: NonterminalNode) { + assertKind(this.cst.kind, NonterminalKind.YulColonAndEqual); + } + + public get colon(): TerminalNode { + return this.fetch().colon; + } + + public get equal(): TerminalNode { + return this.fetch().equal; + } +} + export class YulStackAssignmentStatement { private readonly fetch = once(() => { - const [$assignment, $expression] = ast_internal.selectSequence(this.cst); + const [$assignment, $variable] = ast_internal.selectSequence(this.cst); return { - assignment: new YulAssignmentOperator($assignment as NonterminalNode), - expression: new YulExpression($expression as NonterminalNode), + assignment: new YulStackAssignmentOperator($assignment as NonterminalNode), + variable: $variable as TerminalNode, }; }); @@ -3445,36 +3468,36 @@ export class YulStackAssignmentStatement { assertKind(this.cst.kind, NonterminalKind.YulStackAssignmentStatement); } - public get assignment(): YulAssignmentOperator { + public get assignment(): YulStackAssignmentOperator { return this.fetch().assignment; } - public get expression(): YulExpression { - return this.fetch().expression; + public get variable(): TerminalNode { + return this.fetch().variable; } } -export class YulColonEqual { +export class YulEqualAndColon { private readonly fetch = once(() => { - const [$colon, $equal] = ast_internal.selectSequence(this.cst); + const [$equal, $colon] = ast_internal.selectSequence(this.cst); return { - colon: $colon as TerminalNode, equal: $equal as TerminalNode, + colon: $colon as TerminalNode, }; }); public constructor(public readonly cst: NonterminalNode) { - assertKind(this.cst.kind, NonterminalKind.YulColonEqual); - } - - public get colon(): TerminalNode { - return this.fetch().colon; + assertKind(this.cst.kind, NonterminalKind.YulEqualAndColon); } public get equal(): TerminalNode { return this.fetch().equal; } + + public get colon(): TerminalNode { + return this.fetch().colon; + } } export class YulIfStatement { @@ -4930,7 +4953,7 @@ export class YulStatement { } export class YulAssignmentOperator { - private readonly fetch: () => YulColonEqual | TerminalNode = once(() => { + private readonly fetch: () => YulColonAndEqual | TerminalNode = once(() => { const variant = ast_internal.selectChoice(this.cst); if (variant.type == NodeType.Terminal) { @@ -4938,8 +4961,8 @@ export class YulAssignmentOperator { } switch (variant.kind) { - case NonterminalKind.YulColonEqual: - return new YulColonEqual(variant as NonterminalNode); + case NonterminalKind.YulColonAndEqual: + return new YulColonAndEqual(variant as NonterminalNode); default: assert.fail(`Unexpected variant: ${variant.kind}`); @@ -4950,7 +4973,33 @@ export class YulAssignmentOperator { assertKind(this.cst.kind, NonterminalKind.YulAssignmentOperator); } - public get variant(): YulColonEqual | TerminalNode { + public get variant(): YulColonAndEqual | TerminalNode { + return this.fetch(); + } +} + +export class YulStackAssignmentOperator { + private readonly fetch: () => YulEqualAndColon | TerminalNode = once(() => { + const variant = ast_internal.selectChoice(this.cst); + + if (variant.type == NodeType.Terminal) { + return variant as TerminalNode; + } + + switch (variant.kind) { + case NonterminalKind.YulEqualAndColon: + return new YulEqualAndColon(variant as NonterminalNode); + + default: + assert.fail(`Unexpected variant: ${variant.kind}`); + } + }); + + public constructor(public readonly cst: NonterminalNode) { + assertKind(this.cst.kind, NonterminalKind.YulStackAssignmentOperator); + } + + public get variant(): YulEqualAndColon | TerminalNode { return this.fetch(); } } diff --git a/crates/solidity/outputs/npm/package/src/generated/napi-bindings/generated/index.d.ts b/crates/solidity/outputs/npm/package/src/generated/napi-bindings/generated/index.d.ts index 0dee205b52..f6faf7b08e 100644 --- a/crates/solidity/outputs/npm/package/src/generated/napi-bindings/generated/index.d.ts +++ b/crates/solidity/outputs/npm/package/src/generated/napi-bindings/generated/index.d.ts @@ -196,9 +196,10 @@ export declare namespace kinds { YulBlock = "YulBlock", YulBreakStatement = "YulBreakStatement", YulBuiltInFunction = "YulBuiltInFunction", - YulColonEqual = "YulColonEqual", + YulColonAndEqual = "YulColonAndEqual", YulContinueStatement = "YulContinueStatement", YulDefaultCase = "YulDefaultCase", + YulEqualAndColon = "YulEqualAndColon", YulExpression = "YulExpression", YulForStatement = "YulForStatement", YulFunctionCallExpression = "YulFunctionCallExpression", @@ -213,6 +214,7 @@ export declare namespace kinds { YulPathComponent = "YulPathComponent", YulPaths = "YulPaths", YulReturnsDeclaration = "YulReturnsDeclaration", + YulStackAssignmentOperator = "YulStackAssignmentOperator", YulStackAssignmentStatement = "YulStackAssignmentStatement", YulStatement = "YulStatement", YulStatements = "YulStatements", @@ -352,6 +354,7 @@ export declare namespace kinds { Value = "Value", ValueType = "ValueType", VarKeyword = "VarKeyword", + Variable = "Variable", VariableType = "VariableType", Variables = "Variables", Version = "Version", @@ -416,6 +419,7 @@ export declare namespace kinds { EndOfLine = "EndOfLine", EnumKeyword = "EnumKeyword", Equal = "Equal", + EqualColon = "EqualColon", EqualEqual = "EqualEqual", EqualGreaterThan = "EqualGreaterThan", ErrorKeyword = "ErrorKeyword", diff --git a/crates/solidity/outputs/spec/generated/grammar.ebnf b/crates/solidity/outputs/spec/generated/grammar.ebnf index 3339ca03bd..0265bf652a 100644 --- a/crates/solidity/outputs/spec/generated/grammar.ebnf +++ b/crates/solidity/outputs/spec/generated/grammar.ebnf @@ -532,6 +532,9 @@ COLON_EQUAL = ":="; EQUAL = "="; +(* Deprecated in 0.5.0 *) +EQUAL_COLON = "=:"; + EQUAL_EQUAL = "=="; EQUAL_GREATER_THAN = "=>"; @@ -1658,16 +1661,24 @@ YulVariableAssignmentStatement = (* variables: *) YulPaths (* assignment: *) YulAssignmentOperator (* expression: *) YulExpression; -(* Deprecated in 0.5.0 *) -YulStackAssignmentStatement = (* assignment: *) YulAssignmentOperator - (* expression: *) YulExpression; - -YulAssignmentOperator = (* variant: *) YulColonEqual (* Deprecated in 0.5.5 *) +YulAssignmentOperator = (* variant: *) YulColonAndEqual (* Deprecated in 0.5.5 *) | (* variant: *) COLON_EQUAL; (* Deprecated in 0.5.5 *) -YulColonEqual = (* colon: *) COLON - (* equal: *) EQUAL; +YulColonAndEqual = (* colon: *) COLON + (* equal: *) EQUAL; + +(* Deprecated in 0.5.0 *) +YulStackAssignmentStatement = (* assignment: *) YulStackAssignmentOperator + (* variable: *) YUL_IDENTIFIER; + +(* Deprecated in 0.5.0 *) +YulStackAssignmentOperator = (* variant: *) YulEqualAndColon + | (* variant: *) EQUAL_COLON; + +(* Deprecated in 0.5.0 *) +YulEqualAndColon = (* equal: *) EQUAL + (* colon: *) COLON; YulIfStatement = (* if_keyword: *) YUL_IF_KEYWORD (* condition: *) YulExpression diff --git a/crates/solidity/outputs/spec/generated/public/01-file-structure/09-punctuation.md b/crates/solidity/outputs/spec/generated/public/01-file-structure/09-punctuation.md index 1cd087f1e9..54011f0edd 100644 --- a/crates/solidity/outputs/spec/generated/public/01-file-structure/09-punctuation.md +++ b/crates/solidity/outputs/spec/generated/public/01-file-structure/09-punctuation.md @@ -82,6 +82,12 @@
EQUAL = "=";
+```{ .ebnf #EqualColon } + +``` + +
(* Deprecated in 0.5.0 *)
EQUAL_COLON = "=:";
+ ```{ .ebnf #EqualEqual } ``` 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 22f958f869..3023e54066 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 @@ -70,23 +70,35 @@
YulVariableAssignmentStatement = (* variables: *) YulPaths
(* assignment: *) YulAssignmentOperator
(* expression: *) YulExpression;
+```{ .ebnf #YulAssignmentOperator } + +``` + +
YulAssignmentOperator = (* variant: *) YulColonAndEqual (* Deprecated in 0.5.5 *)
| (* variant: *) COLON_EQUAL;
+ +```{ .ebnf #YulColonAndEqual } + +``` + +
(* Deprecated in 0.5.5 *)
YulColonAndEqual = (* colon: *) COLON
(* equal: *) EQUAL;
+ ```{ .ebnf #YulStackAssignmentStatement } ``` -
(* Deprecated in 0.5.0 *)
YulStackAssignmentStatement = (* assignment: *) YulAssignmentOperator
(* expression: *) YulExpression;
+
(* Deprecated in 0.5.0 *)
YulStackAssignmentStatement = (* assignment: *) YulStackAssignmentOperator
(* variable: *) YUL_IDENTIFIER;
-```{ .ebnf #YulAssignmentOperator } +```{ .ebnf #YulStackAssignmentOperator } ``` -
YulAssignmentOperator = (* variant: *) YulColonEqual (* Deprecated in 0.5.5 *)
| (* variant: *) COLON_EQUAL;
+
(* Deprecated in 0.5.0 *)
YulStackAssignmentOperator = (* variant: *) YulEqualAndColon
| (* variant: *) EQUAL_COLON;
-```{ .ebnf #YulColonEqual } +```{ .ebnf #YulEqualAndColon } ``` -
(* Deprecated in 0.5.5 *)
YulColonEqual = (* colon: *) COLON
(* equal: *) EQUAL;
+
(* Deprecated in 0.5.0 *)
YulEqualAndColon = (* equal: *) EQUAL
(* colon: *) COLON;
```{ .ebnf #YulIfStatement } 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 be3ae26ea3..f98690e44f 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 @@ -10,7 +10,7 @@ Source: > Errors: # 1 total - > - Error: Expected CloseBrace or DoubleQuotedHexStringLiteral or DoubleQuotedStringLiteral or SingleQuotedHexStringLiteral or SingleQuotedStringLiteral or YulAddKeyword or YulAddModKeyword or YulAddressKeyword or YulAndKeyword or YulBalanceKeyword or YulBlockHashKeyword or YulByteKeyword or YulCallCodeKeyword or YulCallDataCopyKeyword or YulCallDataLoadKeyword or YulCallDataSizeKeyword or YulCallKeyword or YulCallValueKeyword or YulCallerKeyword or YulChainIdKeyword or YulCoinBaseKeyword or YulCreateKeyword or YulDecimalLiteral or YulDelegateCallKeyword or YulDifficultyKeyword or YulDivKeyword or YulEqKeyword or YulExpKeyword or YulExtCodeCopyKeyword or YulExtCodeSizeKeyword or YulFalseKeyword or YulGasKeyword or YulGasLimitKeyword or YulGasPriceKeyword or YulGtKeyword or YulHexLiteral or YulIdentifier or YulInvalidKeyword or YulIsZeroKeyword or YulLog0Keyword or YulLog1Keyword or YulLog2Keyword or YulLog3Keyword or YulLog4Keyword or YulLtKeyword or YulMLoadKeyword or YulMSizeKeyword or YulMStore8Keyword or YulMStoreKeyword or YulModKeyword or YulMulKeyword or YulMulModKeyword or YulNotKeyword or YulNumberKeyword or YulOrKeyword or YulOriginKeyword or YulPopKeyword or YulReturnKeyword or YulRevertKeyword or YulSDivKeyword or YulSLoadKeyword or YulSModKeyword or YulSStoreKeyword or YulSarKeyword or YulSelfBalanceKeyword or YulSelfDestructKeyword or YulSgtKeyword or YulSha3Keyword or YulShlKeyword or YulShrKeyword or YulSignExtendKeyword or YulSltKeyword or YulStopKeyword or YulSubKeyword or YulSuicideKeyword or YulTimestampKeyword or YulTrueKeyword or YulXorKeyword. + Error: Expected CloseBrace or DoubleQuotedHexStringLiteral or DoubleQuotedStringLiteral or Equal or EqualColon or OpenBrace or SingleQuotedHexStringLiteral or SingleQuotedStringLiteral or YulAddKeyword or YulAddModKeyword or YulAddressKeyword or YulAndKeyword or YulBalanceKeyword or YulBlockHashKeyword or YulBreakKeyword or YulByteKeyword or YulCallCodeKeyword or YulCallDataCopyKeyword or YulCallDataLoadKeyword or YulCallDataSizeKeyword or YulCallKeyword or YulCallValueKeyword or YulCallerKeyword or YulChainIdKeyword or YulCoinBaseKeyword or YulContinueKeyword or YulCreateKeyword or YulDecimalLiteral or YulDelegateCallKeyword or YulDifficultyKeyword or YulDivKeyword or YulEqKeyword or YulExpKeyword or YulExtCodeCopyKeyword or YulExtCodeSizeKeyword or YulFalseKeyword or YulForKeyword or YulFunctionKeyword or YulGasKeyword or YulGasLimitKeyword or YulGasPriceKeyword or YulGtKeyword or YulHexLiteral or YulIdentifier or YulIfKeyword or YulInvalidKeyword or YulIsZeroKeyword or YulLetKeyword or YulLog0Keyword or YulLog1Keyword or YulLog2Keyword or YulLog3Keyword or YulLog4Keyword or YulLtKeyword or YulMLoadKeyword or YulMSizeKeyword or YulMStore8Keyword or YulMStoreKeyword or YulModKeyword or YulMulKeyword or YulMulModKeyword or YulNotKeyword or YulNumberKeyword or YulOrKeyword or YulOriginKeyword or YulPopKeyword or YulReturnKeyword or YulRevertKeyword or YulSDivKeyword or YulSLoadKeyword or YulSModKeyword or YulSStoreKeyword or YulSarKeyword or YulSelfBalanceKeyword or YulSelfDestructKeyword or YulSgtKeyword or YulSha3Keyword or YulShlKeyword or YulShrKeyword or YulSignExtendKeyword or YulSltKeyword or YulStopKeyword or YulSubKeyword or YulSuicideKeyword or YulSwitchKeyword or YulTimestampKeyword or YulTrueKeyword or YulXorKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/input.sol:4:10] │ 4 │ ╭─▶ result := [mul(a, b) 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 8e41079264..26e0a0083d 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 @@ -10,7 +10,7 @@ Source: > Errors: # 1 total - > - Error: Expected CloseBrace or DoubleQuotedHexStringLiteral or DoubleQuotedStringLiteral or SingleQuotedHexStringLiteral or SingleQuotedStringLiteral or YulAddKeyword or YulAddModKeyword or YulAddressKeyword or YulAndKeyword or YulBalanceKeyword or YulBlockHashKeyword or YulByteKeyword or YulCallCodeKeyword or YulCallDataCopyKeyword or YulCallDataLoadKeyword or YulCallDataSizeKeyword or YulCallKeyword or YulCallValueKeyword or YulCallerKeyword or YulChainIdKeyword or YulCoinBaseKeyword or YulCreate2Keyword or YulCreateKeyword or YulDecimalLiteral or YulDelegateCallKeyword or YulDifficultyKeyword or YulDivKeyword or YulEqKeyword or YulExpKeyword or YulExtCodeCopyKeyword or YulExtCodeSizeKeyword or YulFalseKeyword or YulGasKeyword or YulGasLimitKeyword or YulGasPriceKeyword or YulGtKeyword or YulHexLiteral or YulIdentifier or YulInvalidKeyword or YulIsZeroKeyword or YulKeccak256Keyword or YulLog0Keyword or YulLog1Keyword or YulLog2Keyword or YulLog3Keyword or YulLog4Keyword or YulLtKeyword or YulMLoadKeyword or YulMSizeKeyword or YulMStore8Keyword or YulMStoreKeyword or YulModKeyword or YulMulKeyword or YulMulModKeyword or YulNotKeyword or YulNumberKeyword or YulOrKeyword or YulOriginKeyword or YulPopKeyword or YulReturnDataCopyKeyword or YulReturnDataSizeKeyword or YulReturnKeyword or YulRevertKeyword or YulSDivKeyword or YulSLoadKeyword or YulSModKeyword or YulSStoreKeyword or YulSarKeyword or YulSelfBalanceKeyword or YulSelfDestructKeyword or YulSgtKeyword or YulSha3Keyword or YulShlKeyword or YulShrKeyword or YulSignExtendKeyword or YulSltKeyword or YulStaticCallKeyword or YulStopKeyword or YulSubKeyword or YulSuicideKeyword or YulTimestampKeyword or YulTrueKeyword or YulXorKeyword. + Error: Expected CloseBrace or DoubleQuotedHexStringLiteral or DoubleQuotedStringLiteral or Equal or EqualColon or OpenBrace or SingleQuotedHexStringLiteral or SingleQuotedStringLiteral or YulAddKeyword or YulAddModKeyword or YulAddressKeyword or YulAndKeyword or YulBalanceKeyword or YulBlockHashKeyword or YulBreakKeyword or YulByteKeyword or YulCallCodeKeyword or YulCallDataCopyKeyword or YulCallDataLoadKeyword or YulCallDataSizeKeyword or YulCallKeyword or YulCallValueKeyword or YulCallerKeyword or YulChainIdKeyword or YulCoinBaseKeyword or YulContinueKeyword or YulCreate2Keyword or YulCreateKeyword or YulDecimalLiteral or YulDelegateCallKeyword or YulDifficultyKeyword or YulDivKeyword or YulEqKeyword or YulExpKeyword or YulExtCodeCopyKeyword or YulExtCodeSizeKeyword or YulFalseKeyword or YulForKeyword or YulFunctionKeyword or YulGasKeyword or YulGasLimitKeyword or YulGasPriceKeyword or YulGtKeyword or YulHexLiteral or YulIdentifier or YulIfKeyword or YulInvalidKeyword or YulIsZeroKeyword or YulKeccak256Keyword or YulLetKeyword or YulLog0Keyword or YulLog1Keyword or YulLog2Keyword or YulLog3Keyword or YulLog4Keyword or YulLtKeyword or YulMLoadKeyword or YulMSizeKeyword or YulMStore8Keyword or YulMStoreKeyword or YulModKeyword or YulMulKeyword or YulMulModKeyword or YulNotKeyword or YulNumberKeyword or YulOrKeyword or YulOriginKeyword or YulPopKeyword or YulReturnDataCopyKeyword or YulReturnDataSizeKeyword or YulReturnKeyword or YulRevertKeyword or YulSDivKeyword or YulSLoadKeyword or YulSModKeyword or YulSStoreKeyword or YulSarKeyword or YulSelfBalanceKeyword or YulSelfDestructKeyword or YulSgtKeyword or YulSha3Keyword or YulShlKeyword or YulShrKeyword or YulSignExtendKeyword or YulSltKeyword or YulStaticCallKeyword or YulStopKeyword or YulSubKeyword or YulSuicideKeyword or YulSwitchKeyword or YulTimestampKeyword or YulTrueKeyword or YulXorKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/YulBlock/ignore_unknown_delim/input.sol:4:10] │ 4 │ ╭─▶ result := [mul(a, b) diff --git a/crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/generated/0.4.11-success.yml index 6c63c2a847..e4c5da638f 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/generated/0.4.11-success.yml @@ -5,18 +5,18 @@ Source: > 2 │ 1 │ 2..5 3 │ 2 │ 6..9 4 │ 3 │ 10..13 - 5 │ := success │ 14..26 - 6 │ := success │ 27..39 - 7 │ := success │ 40..52 + 5 │ =: success │ 14..26 + 6 │ =: success │ 27..39 + 7 │ =: success │ 40..52 8 │ } │ 53..54 Errors: [] Tree: - - (YulBlock): # "{\n 1\n 2\n 3\n := success\n := success\n := succe..." (0..55) + - (YulBlock): # "{\n 1\n 2\n 3\n =: success\n =: success\n =: succe..." (0..55) - (open_brace꞉ OpenBrace): "{" # (0..1) - (trailing_trivia꞉ EndOfLine): "\n" # (1..2) - - (statements꞉ YulStatements): # " 1\n 2\n 3\n := success\n := success\n := success..." (2..53) + - (statements꞉ YulStatements): # " 1\n 2\n 3\n =: success\n =: success\n =: success..." (2..53) - (item꞉ YulStatement) ► (variant꞉ YulExpression) ► (variant꞉ YulLiteral): # " 1\n" (2..6) - (leading_trivia꞉ Whitespace): " " # (2..4) - (variant꞉ YulDecimalLiteral): "1" # (4..5) @@ -29,32 +29,26 @@ Tree: - (leading_trivia꞉ Whitespace): " " # (10..12) - (variant꞉ YulDecimalLiteral): "3" # (12..13) - (trailing_trivia꞉ EndOfLine): "\n" # (13..14) - - (item꞉ YulStatement) ► (variant꞉ YulStackAssignmentStatement): # " := success\n" (14..27) - - (assignment꞉ YulAssignmentOperator): # " :=" (14..18) + - (item꞉ YulStatement) ► (variant꞉ YulStackAssignmentStatement): # " =: success\n" (14..27) + - (assignment꞉ YulStackAssignmentOperator): # " =:" (14..18) - (leading_trivia꞉ Whitespace): " " # (14..16) - - (variant꞉ ColonEqual): ":=" # (16..18) - - (expression꞉ YulExpression) ► (variant꞉ YulPath): # " success\n" (18..27) - - (item꞉ YulPathComponent): # " success\n" (18..27) - - (leading_trivia꞉ Whitespace): " " # (18..19) - - (variant꞉ YulIdentifier): "success" # (19..26) - - (trailing_trivia꞉ EndOfLine): "\n" # (26..27) - - (item꞉ YulStatement) ► (variant꞉ YulStackAssignmentStatement): # " := success\n" (27..40) - - (assignment꞉ YulAssignmentOperator): # " :=" (27..31) + - (variant꞉ EqualColon): "=:" # (16..18) + - (leading_trivia꞉ Whitespace): " " # (18..19) + - (variable꞉ YulIdentifier): "success" # (19..26) + - (trailing_trivia꞉ EndOfLine): "\n" # (26..27) + - (item꞉ YulStatement) ► (variant꞉ YulStackAssignmentStatement): # " =: success\n" (27..40) + - (assignment꞉ YulStackAssignmentOperator): # " =:" (27..31) - (leading_trivia꞉ Whitespace): " " # (27..29) - - (variant꞉ ColonEqual): ":=" # (29..31) - - (expression꞉ YulExpression) ► (variant꞉ YulPath): # " success\n" (31..40) - - (item꞉ YulPathComponent): # " success\n" (31..40) - - (leading_trivia꞉ Whitespace): " " # (31..32) - - (variant꞉ YulIdentifier): "success" # (32..39) - - (trailing_trivia꞉ EndOfLine): "\n" # (39..40) - - (item꞉ YulStatement) ► (variant꞉ YulStackAssignmentStatement): # " := success\n" (40..53) - - (assignment꞉ YulAssignmentOperator): # " :=" (40..44) + - (variant꞉ EqualColon): "=:" # (29..31) + - (leading_trivia꞉ Whitespace): " " # (31..32) + - (variable꞉ YulIdentifier): "success" # (32..39) + - (trailing_trivia꞉ EndOfLine): "\n" # (39..40) + - (item꞉ YulStatement) ► (variant꞉ YulStackAssignmentStatement): # " =: success\n" (40..53) + - (assignment꞉ YulStackAssignmentOperator): # " =:" (40..44) - (leading_trivia꞉ Whitespace): " " # (40..42) - - (variant꞉ ColonEqual): ":=" # (42..44) - - (expression꞉ YulExpression) ► (variant꞉ YulPath): # " success\n" (44..53) - - (item꞉ YulPathComponent): # " success\n" (44..53) - - (leading_trivia꞉ Whitespace): " " # (44..45) - - (variant꞉ YulIdentifier): "success" # (45..52) - - (trailing_trivia꞉ EndOfLine): "\n" # (52..53) + - (variant꞉ EqualColon): "=:" # (42..44) + - (leading_trivia꞉ Whitespace): " " # (44..45) + - (variable꞉ YulIdentifier): "success" # (45..52) + - (trailing_trivia꞉ EndOfLine): "\n" # (52..53) - (close_brace꞉ CloseBrace): "}" # (53..54) - (trailing_trivia꞉ EndOfLine): "\n" # (54..55) diff --git a/crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/generated/0.5.0-failure.yml index 5ca8dcf85e..c56d6d7e3d 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/generated/0.5.0-failure.yml @@ -5,9 +5,9 @@ Source: > 2 │ 1 │ 2..5 3 │ 2 │ 6..9 4 │ 3 │ 10..13 - 5 │ := success │ 14..26 - 6 │ := success │ 27..39 - 7 │ := success │ 40..52 + 5 │ =: success │ 14..26 + 6 │ =: success │ 27..39 + 7 │ =: success │ 40..52 8 │ } │ 53..54 Errors: # 1 total @@ -15,15 +15,15 @@ Errors: # 1 total Error: Expected CloseBrace or DoubleQuotedHexStringLiteral or DoubleQuotedStringLiteral or OpenBrace or SingleQuotedHexStringLiteral or SingleQuotedStringLiteral or YulAddKeyword or YulAddModKeyword or YulAddressKeyword or YulAndKeyword or YulBalanceKeyword or YulBlockHashKeyword or YulBreakKeyword or YulByteKeyword or YulCallCodeKeyword or YulCallDataCopyKeyword or YulCallDataLoadKeyword or YulCallDataSizeKeyword or YulCallKeyword or YulCallValueKeyword or YulCallerKeyword or YulChainIdKeyword or YulCoinBaseKeyword or YulContinueKeyword or YulCreate2Keyword or YulCreateKeyword or YulDecimalLiteral or YulDelegateCallKeyword or YulDifficultyKeyword or YulDivKeyword or YulEqKeyword or YulExpKeyword or YulExtCodeCopyKeyword or YulExtCodeHashKeyword or YulExtCodeSizeKeyword or YulFalseKeyword or YulForKeyword or YulFunctionKeyword or YulGasKeyword or YulGasLimitKeyword or YulGasPriceKeyword or YulGtKeyword or YulHexLiteral or YulIdentifier or YulIfKeyword or YulInvalidKeyword or YulIsZeroKeyword or YulKeccak256Keyword or YulLetKeyword or YulLog0Keyword or YulLog1Keyword or YulLog2Keyword or YulLog3Keyword or YulLog4Keyword or YulLtKeyword or YulMLoadKeyword or YulMSizeKeyword or YulMStore8Keyword or YulMStoreKeyword or YulModKeyword or YulMulKeyword or YulMulModKeyword or YulNotKeyword or YulNumberKeyword or YulOrKeyword or YulOriginKeyword or YulPopKeyword or YulReturnDataCopyKeyword or YulReturnDataSizeKeyword or YulReturnKeyword or YulRevertKeyword or YulSDivKeyword or YulSLoadKeyword or YulSModKeyword or YulSStoreKeyword or YulSarKeyword or YulSelfBalanceKeyword or YulSelfDestructKeyword or YulSgtKeyword or YulShlKeyword or YulShrKeyword or YulSignExtendKeyword or YulSltKeyword or YulStaticCallKeyword or YulStopKeyword or YulSubKeyword or YulSwitchKeyword or YulTimestampKeyword or YulTrueKeyword or YulXorKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/input.sol:5:3] │ - 5 │ ╭─▶ := success + 5 │ ╭─▶ =: success ┆ ┆ - 7 │ ├─▶ := success + 7 │ ├─▶ =: success │ │ │ ╰────────────────── Error occurred here. ───╯ Tree: - - (YulBlock): # "{\n 1\n 2\n 3\n := success\n := success\n := succe..." (0..55) + - (YulBlock): # "{\n 1\n 2\n 3\n =: success\n =: success\n =: succe..." (0..55) - (open_brace꞉ OpenBrace): "{" # (0..1) - (trailing_trivia꞉ EndOfLine): "\n" # (1..2) - (statements꞉ YulStatements): # " 1\n 2\n 3\n" (2..14) @@ -40,6 +40,6 @@ Tree: - (variant꞉ YulDecimalLiteral): "3" # (12..13) - (trailing_trivia꞉ EndOfLine): "\n" # (13..14) - (leading_trivia꞉ Whitespace): " " # (14..16) - - (UNRECOGNIZED): ":= success\n := success\n := success\n" # (16..53) + - (UNRECOGNIZED): "=: success\n =: success\n =: success\n" # (16..53) - (close_brace꞉ CloseBrace): "}" # (53..54) - (trailing_trivia꞉ EndOfLine): "\n" # (54..55) diff --git a/crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/generated/0.6.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/generated/0.6.0-failure.yml index 1b126e3865..7a5deebe13 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/generated/0.6.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/generated/0.6.0-failure.yml @@ -5,9 +5,9 @@ Source: > 2 │ 1 │ 2..5 3 │ 2 │ 6..9 4 │ 3 │ 10..13 - 5 │ := success │ 14..26 - 6 │ := success │ 27..39 - 7 │ := success │ 40..52 + 5 │ =: success │ 14..26 + 6 │ =: success │ 27..39 + 7 │ =: success │ 40..52 8 │ } │ 53..54 Errors: # 1 total @@ -15,15 +15,15 @@ Errors: # 1 total Error: Expected CloseBrace or DoubleQuotedHexStringLiteral or DoubleQuotedStringLiteral or OpenBrace or SingleQuotedHexStringLiteral or SingleQuotedStringLiteral or YulAddKeyword or YulAddModKeyword or YulAddressKeyword or YulAndKeyword or YulBalanceKeyword or YulBlockHashKeyword or YulBreakKeyword or YulByteKeyword or YulCallCodeKeyword or YulCallDataCopyKeyword or YulCallDataLoadKeyword or YulCallDataSizeKeyword or YulCallKeyword or YulCallValueKeyword or YulCallerKeyword or YulChainIdKeyword or YulCoinBaseKeyword or YulContinueKeyword or YulCreate2Keyword or YulCreateKeyword or YulDecimalLiteral or YulDelegateCallKeyword or YulDifficultyKeyword or YulDivKeyword or YulEqKeyword or YulExpKeyword or YulExtCodeCopyKeyword or YulExtCodeHashKeyword or YulExtCodeSizeKeyword or YulFalseKeyword or YulForKeyword or YulFunctionKeyword or YulGasKeyword or YulGasLimitKeyword or YulGasPriceKeyword or YulGtKeyword or YulHexLiteral or YulIdentifier or YulIfKeyword or YulInvalidKeyword or YulIsZeroKeyword or YulKeccak256Keyword or YulLeaveKeyword or YulLetKeyword or YulLog0Keyword or YulLog1Keyword or YulLog2Keyword or YulLog3Keyword or YulLog4Keyword or YulLtKeyword or YulMLoadKeyword or YulMSizeKeyword or YulMStore8Keyword or YulMStoreKeyword or YulModKeyword or YulMulKeyword or YulMulModKeyword or YulNotKeyword or YulNumberKeyword or YulOrKeyword or YulOriginKeyword or YulPopKeyword or YulReturnDataCopyKeyword or YulReturnDataSizeKeyword or YulReturnKeyword or YulRevertKeyword or YulSDivKeyword or YulSLoadKeyword or YulSModKeyword or YulSStoreKeyword or YulSarKeyword or YulSelfBalanceKeyword or YulSelfDestructKeyword or YulSgtKeyword or YulShlKeyword or YulShrKeyword or YulSignExtendKeyword or YulSltKeyword or YulStaticCallKeyword or YulStopKeyword or YulSubKeyword or YulSwitchKeyword or YulTimestampKeyword or YulTrueKeyword or YulXorKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/input.sol:5:3] │ - 5 │ ╭─▶ := success + 5 │ ╭─▶ =: success ┆ ┆ - 7 │ ├─▶ := success + 7 │ ├─▶ =: success │ │ │ ╰────────────────── Error occurred here. ───╯ Tree: - - (YulBlock): # "{\n 1\n 2\n 3\n := success\n := success\n := succe..." (0..55) + - (YulBlock): # "{\n 1\n 2\n 3\n =: success\n =: success\n =: succe..." (0..55) - (open_brace꞉ OpenBrace): "{" # (0..1) - (trailing_trivia꞉ EndOfLine): "\n" # (1..2) - (statements꞉ YulStatements): # " 1\n 2\n 3\n" (2..14) @@ -40,6 +40,6 @@ Tree: - (variant꞉ YulDecimalLiteral): "3" # (12..13) - (trailing_trivia꞉ EndOfLine): "\n" # (13..14) - (leading_trivia꞉ Whitespace): " " # (14..16) - - (UNRECOGNIZED): ":= success\n := success\n := success\n" # (16..53) + - (UNRECOGNIZED): "=: success\n =: success\n =: success\n" # (16..53) - (close_brace꞉ CloseBrace): "}" # (53..54) - (trailing_trivia꞉ EndOfLine): "\n" # (54..55) diff --git a/crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/generated/0.8.10-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/generated/0.8.10-failure.yml index 770c6a3a0c..1e429c2819 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/generated/0.8.10-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/generated/0.8.10-failure.yml @@ -5,9 +5,9 @@ Source: > 2 │ 1 │ 2..5 3 │ 2 │ 6..9 4 │ 3 │ 10..13 - 5 │ := success │ 14..26 - 6 │ := success │ 27..39 - 7 │ := success │ 40..52 + 5 │ =: success │ 14..26 + 6 │ =: success │ 27..39 + 7 │ =: success │ 40..52 8 │ } │ 53..54 Errors: # 1 total @@ -15,15 +15,15 @@ Errors: # 1 total Error: Expected CloseBrace or DoubleQuotedHexStringLiteral or DoubleQuotedStringLiteral or OpenBrace or SingleQuotedHexStringLiteral or SingleQuotedStringLiteral or YulAddKeyword or YulAddModKeyword or YulAddressKeyword or YulAndKeyword or YulBalanceKeyword or YulBaseFeeKeyword or YulBlockHashKeyword or YulBreakKeyword or YulByteKeyword or YulCallCodeKeyword or YulCallDataCopyKeyword or YulCallDataLoadKeyword or YulCallDataSizeKeyword or YulCallKeyword or YulCallValueKeyword or YulCallerKeyword or YulChainIdKeyword or YulCoinBaseKeyword or YulContinueKeyword or YulCreate2Keyword or YulCreateKeyword or YulDecimalLiteral or YulDelegateCallKeyword or YulDifficultyKeyword or YulDivKeyword or YulEqKeyword or YulExpKeyword or YulExtCodeCopyKeyword or YulExtCodeHashKeyword or YulExtCodeSizeKeyword or YulFalseKeyword or YulForKeyword or YulFunctionKeyword or YulGasKeyword or YulGasLimitKeyword or YulGasPriceKeyword or YulGtKeyword or YulHexLiteral or YulIdentifier or YulIfKeyword or YulInvalidKeyword or YulIsZeroKeyword or YulKeccak256Keyword or YulLeaveKeyword or YulLetKeyword or YulLog0Keyword or YulLog1Keyword or YulLog2Keyword or YulLog3Keyword or YulLog4Keyword or YulLtKeyword or YulMLoadKeyword or YulMSizeKeyword or YulMStore8Keyword or YulMStoreKeyword or YulModKeyword or YulMulKeyword or YulMulModKeyword or YulNotKeyword or YulNumberKeyword or YulOrKeyword or YulOriginKeyword or YulPopKeyword or YulReturnDataCopyKeyword or YulReturnDataSizeKeyword or YulReturnKeyword or YulRevertKeyword or YulSDivKeyword or YulSLoadKeyword or YulSModKeyword or YulSStoreKeyword or YulSarKeyword or YulSelfBalanceKeyword or YulSelfDestructKeyword or YulSgtKeyword or YulShlKeyword or YulShrKeyword or YulSignExtendKeyword or YulSltKeyword or YulStaticCallKeyword or YulStopKeyword or YulSubKeyword or YulSwitchKeyword or YulTimestampKeyword or YulTrueKeyword or YulXorKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/input.sol:5:3] │ - 5 │ ╭─▶ := success + 5 │ ╭─▶ =: success ┆ ┆ - 7 │ ├─▶ := success + 7 │ ├─▶ =: success │ │ │ ╰────────────────── Error occurred here. ───╯ Tree: - - (YulBlock): # "{\n 1\n 2\n 3\n := success\n := success\n := succe..." (0..55) + - (YulBlock): # "{\n 1\n 2\n 3\n =: success\n =: success\n =: succe..." (0..55) - (open_brace꞉ OpenBrace): "{" # (0..1) - (trailing_trivia꞉ EndOfLine): "\n" # (1..2) - (statements꞉ YulStatements): # " 1\n 2\n 3\n" (2..14) @@ -40,6 +40,6 @@ Tree: - (variant꞉ YulDecimalLiteral): "3" # (12..13) - (trailing_trivia꞉ EndOfLine): "\n" # (13..14) - (leading_trivia꞉ Whitespace): " " # (14..16) - - (UNRECOGNIZED): ":= success\n := success\n := success\n" # (16..53) + - (UNRECOGNIZED): "=: success\n =: success\n =: success\n" # (16..53) - (close_brace꞉ CloseBrace): "}" # (53..54) - (trailing_trivia꞉ EndOfLine): "\n" # (54..55) diff --git a/crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/generated/0.8.18-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/generated/0.8.18-failure.yml index ca97c7f9f4..b9cee7fafc 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/generated/0.8.18-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/generated/0.8.18-failure.yml @@ -5,9 +5,9 @@ Source: > 2 │ 1 │ 2..5 3 │ 2 │ 6..9 4 │ 3 │ 10..13 - 5 │ := success │ 14..26 - 6 │ := success │ 27..39 - 7 │ := success │ 40..52 + 5 │ =: success │ 14..26 + 6 │ =: success │ 27..39 + 7 │ =: success │ 40..52 8 │ } │ 53..54 Errors: # 1 total @@ -15,15 +15,15 @@ Errors: # 1 total Error: Expected CloseBrace or DoubleQuotedHexStringLiteral or DoubleQuotedStringLiteral or OpenBrace or SingleQuotedHexStringLiteral or SingleQuotedStringLiteral or YulAddKeyword or YulAddModKeyword or YulAddressKeyword or YulAndKeyword or YulBalanceKeyword or YulBaseFeeKeyword or YulBlockHashKeyword or YulBreakKeyword or YulByteKeyword or YulCallCodeKeyword or YulCallDataCopyKeyword or YulCallDataLoadKeyword or YulCallDataSizeKeyword or YulCallKeyword or YulCallValueKeyword or YulCallerKeyword or YulChainIdKeyword or YulCoinBaseKeyword or YulContinueKeyword or YulCreate2Keyword or YulCreateKeyword or YulDecimalLiteral or YulDelegateCallKeyword or YulDivKeyword or YulEqKeyword or YulExpKeyword or YulExtCodeCopyKeyword or YulExtCodeHashKeyword or YulExtCodeSizeKeyword or YulFalseKeyword or YulForKeyword or YulFunctionKeyword or YulGasKeyword or YulGasLimitKeyword or YulGasPriceKeyword or YulGtKeyword or YulHexLiteral or YulIdentifier or YulIfKeyword or YulInvalidKeyword or YulIsZeroKeyword or YulKeccak256Keyword or YulLeaveKeyword or YulLetKeyword or YulLog0Keyword or YulLog1Keyword or YulLog2Keyword or YulLog3Keyword or YulLog4Keyword or YulLtKeyword or YulMLoadKeyword or YulMSizeKeyword or YulMStore8Keyword or YulMStoreKeyword or YulModKeyword or YulMulKeyword or YulMulModKeyword or YulNotKeyword or YulNumberKeyword or YulOrKeyword or YulOriginKeyword or YulPopKeyword or YulPrevRandaoKeyword or YulReturnDataCopyKeyword or YulReturnDataSizeKeyword or YulReturnKeyword or YulRevertKeyword or YulSDivKeyword or YulSLoadKeyword or YulSModKeyword or YulSStoreKeyword or YulSarKeyword or YulSelfBalanceKeyword or YulSelfDestructKeyword or YulSgtKeyword or YulShlKeyword or YulShrKeyword or YulSignExtendKeyword or YulSltKeyword or YulStaticCallKeyword or YulStopKeyword or YulSubKeyword or YulSwitchKeyword or YulTimestampKeyword or YulTrueKeyword or YulXorKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/input.sol:5:3] │ - 5 │ ╭─▶ := success + 5 │ ╭─▶ =: success ┆ ┆ - 7 │ ├─▶ := success + 7 │ ├─▶ =: success │ │ │ ╰────────────────── Error occurred here. ───╯ Tree: - - (YulBlock): # "{\n 1\n 2\n 3\n := success\n := success\n := succe..." (0..55) + - (YulBlock): # "{\n 1\n 2\n 3\n =: success\n =: success\n =: succe..." (0..55) - (open_brace꞉ OpenBrace): "{" # (0..1) - (trailing_trivia꞉ EndOfLine): "\n" # (1..2) - (statements꞉ YulStatements): # " 1\n 2\n 3\n" (2..14) @@ -40,6 +40,6 @@ Tree: - (variant꞉ YulDecimalLiteral): "3" # (12..13) - (trailing_trivia꞉ EndOfLine): "\n" # (13..14) - (leading_trivia꞉ Whitespace): " " # (14..16) - - (UNRECOGNIZED): ":= success\n := success\n := success\n" # (16..53) + - (UNRECOGNIZED): "=: success\n =: success\n =: success\n" # (16..53) - (close_brace꞉ CloseBrace): "}" # (53..54) - (trailing_trivia꞉ EndOfLine): "\n" # (54..55) diff --git a/crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/generated/0.8.24-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/generated/0.8.24-failure.yml index 085d5c3c5b..4468da3e94 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/generated/0.8.24-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/generated/0.8.24-failure.yml @@ -5,9 +5,9 @@ Source: > 2 │ 1 │ 2..5 3 │ 2 │ 6..9 4 │ 3 │ 10..13 - 5 │ := success │ 14..26 - 6 │ := success │ 27..39 - 7 │ := success │ 40..52 + 5 │ =: success │ 14..26 + 6 │ =: success │ 27..39 + 7 │ =: success │ 40..52 8 │ } │ 53..54 Errors: # 1 total @@ -15,15 +15,15 @@ Errors: # 1 total Error: Expected CloseBrace or DoubleQuotedHexStringLiteral or DoubleQuotedStringLiteral or OpenBrace or SingleQuotedHexStringLiteral or SingleQuotedStringLiteral or YulAddKeyword or YulAddModKeyword or YulAddressKeyword or YulAndKeyword or YulBalanceKeyword or YulBaseFeeKeyword or YulBlobBaseFeeKeyword or YulBlobHashKeyword or YulBlockHashKeyword or YulBreakKeyword or YulByteKeyword or YulCallCodeKeyword or YulCallDataCopyKeyword or YulCallDataLoadKeyword or YulCallDataSizeKeyword or YulCallKeyword or YulCallValueKeyword or YulCallerKeyword or YulChainIdKeyword or YulCoinBaseKeyword or YulContinueKeyword or YulCreate2Keyword or YulCreateKeyword or YulDecimalLiteral or YulDelegateCallKeyword or YulDivKeyword or YulEqKeyword or YulExpKeyword or YulExtCodeCopyKeyword or YulExtCodeHashKeyword or YulExtCodeSizeKeyword or YulFalseKeyword or YulForKeyword or YulFunctionKeyword or YulGasKeyword or YulGasLimitKeyword or YulGasPriceKeyword or YulGtKeyword or YulHexLiteral or YulIdentifier or YulIfKeyword or YulInvalidKeyword or YulIsZeroKeyword or YulKeccak256Keyword or YulLeaveKeyword or YulLetKeyword or YulLog0Keyword or YulLog1Keyword or YulLog2Keyword or YulLog3Keyword or YulLog4Keyword or YulLtKeyword or YulMCopyKeyword or YulMLoadKeyword or YulMSizeKeyword or YulMStore8Keyword or YulMStoreKeyword or YulModKeyword or YulMulKeyword or YulMulModKeyword or YulNotKeyword or YulNumberKeyword or YulOrKeyword or YulOriginKeyword or YulPopKeyword or YulPrevRandaoKeyword or YulReturnDataCopyKeyword or YulReturnDataSizeKeyword or YulReturnKeyword or YulRevertKeyword or YulSDivKeyword or YulSLoadKeyword or YulSModKeyword or YulSStoreKeyword or YulSarKeyword or YulSelfBalanceKeyword or YulSelfDestructKeyword or YulSgtKeyword or YulShlKeyword or YulShrKeyword or YulSignExtendKeyword or YulSltKeyword or YulStaticCallKeyword or YulStopKeyword or YulSubKeyword or YulSwitchKeyword or YulTLoadKeyword or YulTStoreKeyword or YulTimestampKeyword or YulTrueKeyword or YulXorKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/input.sol:5:3] │ - 5 │ ╭─▶ := success + 5 │ ╭─▶ =: success ┆ ┆ - 7 │ ├─▶ := success + 7 │ ├─▶ =: success │ │ │ ╰────────────────── Error occurred here. ───╯ Tree: - - (YulBlock): # "{\n 1\n 2\n 3\n := success\n := success\n := succe..." (0..55) + - (YulBlock): # "{\n 1\n 2\n 3\n =: success\n =: success\n =: succe..." (0..55) - (open_brace꞉ OpenBrace): "{" # (0..1) - (trailing_trivia꞉ EndOfLine): "\n" # (1..2) - (statements꞉ YulStatements): # " 1\n 2\n 3\n" (2..14) @@ -40,6 +40,6 @@ Tree: - (variant꞉ YulDecimalLiteral): "3" # (12..13) - (trailing_trivia꞉ EndOfLine): "\n" # (13..14) - (leading_trivia꞉ Whitespace): " " # (14..16) - - (UNRECOGNIZED): ":= success\n := success\n := success\n" # (16..53) + - (UNRECOGNIZED): "=: success\n =: success\n =: success\n" # (16..53) - (close_brace꞉ CloseBrace): "}" # (53..54) - (trailing_trivia꞉ EndOfLine): "\n" # (54..55) diff --git a/crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/generated/0.8.7-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/generated/0.8.7-failure.yml index 770c6a3a0c..1e429c2819 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/generated/0.8.7-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/generated/0.8.7-failure.yml @@ -5,9 +5,9 @@ Source: > 2 │ 1 │ 2..5 3 │ 2 │ 6..9 4 │ 3 │ 10..13 - 5 │ := success │ 14..26 - 6 │ := success │ 27..39 - 7 │ := success │ 40..52 + 5 │ =: success │ 14..26 + 6 │ =: success │ 27..39 + 7 │ =: success │ 40..52 8 │ } │ 53..54 Errors: # 1 total @@ -15,15 +15,15 @@ Errors: # 1 total Error: Expected CloseBrace or DoubleQuotedHexStringLiteral or DoubleQuotedStringLiteral or OpenBrace or SingleQuotedHexStringLiteral or SingleQuotedStringLiteral or YulAddKeyword or YulAddModKeyword or YulAddressKeyword or YulAndKeyword or YulBalanceKeyword or YulBaseFeeKeyword or YulBlockHashKeyword or YulBreakKeyword or YulByteKeyword or YulCallCodeKeyword or YulCallDataCopyKeyword or YulCallDataLoadKeyword or YulCallDataSizeKeyword or YulCallKeyword or YulCallValueKeyword or YulCallerKeyword or YulChainIdKeyword or YulCoinBaseKeyword or YulContinueKeyword or YulCreate2Keyword or YulCreateKeyword or YulDecimalLiteral or YulDelegateCallKeyword or YulDifficultyKeyword or YulDivKeyword or YulEqKeyword or YulExpKeyword or YulExtCodeCopyKeyword or YulExtCodeHashKeyword or YulExtCodeSizeKeyword or YulFalseKeyword or YulForKeyword or YulFunctionKeyword or YulGasKeyword or YulGasLimitKeyword or YulGasPriceKeyword or YulGtKeyword or YulHexLiteral or YulIdentifier or YulIfKeyword or YulInvalidKeyword or YulIsZeroKeyword or YulKeccak256Keyword or YulLeaveKeyword or YulLetKeyword or YulLog0Keyword or YulLog1Keyword or YulLog2Keyword or YulLog3Keyword or YulLog4Keyword or YulLtKeyword or YulMLoadKeyword or YulMSizeKeyword or YulMStore8Keyword or YulMStoreKeyword or YulModKeyword or YulMulKeyword or YulMulModKeyword or YulNotKeyword or YulNumberKeyword or YulOrKeyword or YulOriginKeyword or YulPopKeyword or YulReturnDataCopyKeyword or YulReturnDataSizeKeyword or YulReturnKeyword or YulRevertKeyword or YulSDivKeyword or YulSLoadKeyword or YulSModKeyword or YulSStoreKeyword or YulSarKeyword or YulSelfBalanceKeyword or YulSelfDestructKeyword or YulSgtKeyword or YulShlKeyword or YulShrKeyword or YulSignExtendKeyword or YulSltKeyword or YulStaticCallKeyword or YulStopKeyword or YulSubKeyword or YulSwitchKeyword or YulTimestampKeyword or YulTrueKeyword or YulXorKeyword. ╭─[crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/input.sol:5:3] │ - 5 │ ╭─▶ := success + 5 │ ╭─▶ =: success ┆ ┆ - 7 │ ├─▶ := success + 7 │ ├─▶ =: success │ │ │ ╰────────────────── Error occurred here. ───╯ Tree: - - (YulBlock): # "{\n 1\n 2\n 3\n := success\n := success\n := succe..." (0..55) + - (YulBlock): # "{\n 1\n 2\n 3\n =: success\n =: success\n =: succe..." (0..55) - (open_brace꞉ OpenBrace): "{" # (0..1) - (trailing_trivia꞉ EndOfLine): "\n" # (1..2) - (statements꞉ YulStatements): # " 1\n 2\n 3\n" (2..14) @@ -40,6 +40,6 @@ Tree: - (variant꞉ YulDecimalLiteral): "3" # (12..13) - (trailing_trivia꞉ EndOfLine): "\n" # (13..14) - (leading_trivia꞉ Whitespace): " " # (14..16) - - (UNRECOGNIZED): ":= success\n := success\n := success\n" # (16..53) + - (UNRECOGNIZED): "=: success\n =: success\n =: success\n" # (16..53) - (close_brace꞉ CloseBrace): "}" # (53..54) - (trailing_trivia꞉ EndOfLine): "\n" # (54..55) diff --git a/crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/input.sol b/crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/input.sol index 9e243996e5..511a42b5b4 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/input.sol +++ b/crates/solidity/testing/snapshots/cst_output/YulBlock/multiple_stack_assignments/input.sol @@ -2,7 +2,7 @@ 1 2 3 - := success - := success - := success + =: success + =: success + =: success } diff --git a/crates/solidity/testing/snapshots/cst_output/YulStackAssignmentStatement/equal_colon_separated/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/YulStackAssignmentStatement/equal_colon_separated/generated/0.4.11-success.yml new file mode 100644 index 0000000000..b9d9774399 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/YulStackAssignmentStatement/equal_colon_separated/generated/0.4.11-success.yml @@ -0,0 +1,16 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ = : success │ 0..11 + +Errors: [] + +Tree: + - (YulStackAssignmentStatement): # "= : success\n" (0..12) + - (assignment꞉ YulStackAssignmentOperator) ► (variant꞉ YulEqualAndColon): # "= :" (0..3) + - (equal꞉ Equal): "=" # (0..1) + - (leading_trivia꞉ Whitespace): " " # (1..2) + - (colon꞉ Colon): ":" # (2..3) + - (leading_trivia꞉ Whitespace): " " # (3..4) + - (variable꞉ YulIdentifier): "success" # (4..11) + - (trailing_trivia꞉ EndOfLine): "\n" # (11..12) diff --git a/crates/solidity/testing/snapshots/cst_output/YulStackAssignmentStatement/equal_colon_separated/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulStackAssignmentStatement/equal_colon_separated/generated/0.5.0-failure.yml new file mode 100644 index 0000000000..13d3aa868a --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/YulStackAssignmentStatement/equal_colon_separated/generated/0.5.0-failure.yml @@ -0,0 +1,17 @@ +# This file is generated automatically by infrastructure scripts. Please don't edit by hand. + +Source: > + 1 │ = : success │ 0..11 + +Errors: # 1 total + - > + Error: Expected end of file. + ╭─[crates/solidity/testing/snapshots/cst_output/YulStackAssignmentStatement/equal_colon_separated/input.sol:1:1] + │ + 1 │ = : success + │ ──────┬───── + │ ╰─────── Error occurred here. + ───╯ + +Tree: + - (UNRECOGNIZED): "= : success\n" # (0..12) diff --git a/crates/solidity/testing/snapshots/cst_output/YulStackAssignmentStatement/equal_colon_separated/input.sol b/crates/solidity/testing/snapshots/cst_output/YulStackAssignmentStatement/equal_colon_separated/input.sol new file mode 100644 index 0000000000..f2238dd1e6 --- /dev/null +++ b/crates/solidity/testing/snapshots/cst_output/YulStackAssignmentStatement/equal_colon_separated/input.sol @@ -0,0 +1 @@ += : success diff --git a/crates/solidity/testing/snapshots/cst_output/YulStackAssignmentStatement/single_variable/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/YulStackAssignmentStatement/single_variable/generated/0.4.11-success.yml index 0a69b5894f..96ffd28707 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulStackAssignmentStatement/single_variable/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulStackAssignmentStatement/single_variable/generated/0.4.11-success.yml @@ -1,15 +1,13 @@ # This file is generated automatically by infrastructure scripts. Please don't edit by hand. Source: > - 1 │ := success │ 0..10 + 1 │ =: success │ 0..10 Errors: [] Tree: - - (YulStackAssignmentStatement): # ":= success\n" (0..11) - - (assignment꞉ YulAssignmentOperator) ► (variant꞉ ColonEqual): ":=" # (0..2) - - (expression꞉ YulExpression) ► (variant꞉ YulPath): # " success\n" (2..11) - - (item꞉ YulPathComponent): # " success\n" (2..11) - - (leading_trivia꞉ Whitespace): " " # (2..3) - - (variant꞉ YulIdentifier): "success" # (3..10) - - (trailing_trivia꞉ EndOfLine): "\n" # (10..11) + - (YulStackAssignmentStatement): # "=: success\n" (0..11) + - (assignment꞉ YulStackAssignmentOperator) ► (variant꞉ EqualColon): "=:" # (0..2) + - (leading_trivia꞉ Whitespace): " " # (2..3) + - (variable꞉ YulIdentifier): "success" # (3..10) + - (trailing_trivia꞉ EndOfLine): "\n" # (10..11) diff --git a/crates/solidity/testing/snapshots/cst_output/YulStackAssignmentStatement/single_variable/generated/0.5.0-failure.yml b/crates/solidity/testing/snapshots/cst_output/YulStackAssignmentStatement/single_variable/generated/0.5.0-failure.yml index d1e17893f7..0de1a8336f 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulStackAssignmentStatement/single_variable/generated/0.5.0-failure.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulStackAssignmentStatement/single_variable/generated/0.5.0-failure.yml @@ -1,17 +1,17 @@ # This file is generated automatically by infrastructure scripts. Please don't edit by hand. Source: > - 1 │ := success │ 0..10 + 1 │ =: success │ 0..10 Errors: # 1 total - > Error: Expected end of file. ╭─[crates/solidity/testing/snapshots/cst_output/YulStackAssignmentStatement/single_variable/input.sol:1:1] │ - 1 │ := success + 1 │ =: success │ ─────┬───── │ ╰─────── Error occurred here. ───╯ Tree: - - (UNRECOGNIZED): ":= success\n" # (0..11) + - (UNRECOGNIZED): "=: success\n" # (0..11) diff --git a/crates/solidity/testing/snapshots/cst_output/YulStackAssignmentStatement/single_variable/input.sol b/crates/solidity/testing/snapshots/cst_output/YulStackAssignmentStatement/single_variable/input.sol index 937bbb2187..09a79bb71d 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulStackAssignmentStatement/single_variable/input.sol +++ b/crates/solidity/testing/snapshots/cst_output/YulStackAssignmentStatement/single_variable/input.sol @@ -1 +1 @@ -:= success +=: success diff --git a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/colon_equal_separated/generated/0.4.11-success.yml b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/colon_equal_separated/generated/0.4.11-success.yml index d25c9af2dc..3c61b84dc9 100644 --- a/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/colon_equal_separated/generated/0.4.11-success.yml +++ b/crates/solidity/testing/snapshots/cst_output/YulVariableAssignmentStatement/colon_equal_separated/generated/0.4.11-success.yml @@ -14,7 +14,7 @@ Tree: - (leading_trivia꞉ SingleLineComment): '// ColonEqual was two separate tokens before "0.5....' # (0..53) - (leading_trivia꞉ EndOfLine): "\n" # (53..54) - (variant꞉ YulIdentifier): "foo" # (54..57) - - (assignment꞉ YulAssignmentOperator) ► (variant꞉ YulColonEqual): # " : =" (57..61) + - (assignment꞉ YulAssignmentOperator) ► (variant꞉ YulColonAndEqual): # " : =" (57..61) - (leading_trivia꞉ Whitespace): " " # (57..58) - (colon꞉ Colon): ":" # (58..59) - (leading_trivia꞉ Whitespace): " " # (59..60) 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 index 639bdcbbb1..acab1a0242 100644 --- 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 @@ -15,7 +15,7 @@ Tree: - (leading_trivia꞉ Whitespace): " " # (57..58) - (item꞉ YulIdentifier): "foo" # (58..61) - (value꞉ YulVariableDeclarationValue): # " : = 0\n" (61..68) - - (assignment꞉ YulAssignmentOperator) ► (variant꞉ YulColonEqual): # " : =" (61..65) + - (assignment꞉ YulAssignmentOperator) ► (variant꞉ YulColonAndEqual): # " : =" (61..65) - (leading_trivia꞉ Whitespace): " " # (61..62) - (colon꞉ Colon): ":" # (62..63) - (leading_trivia꞉ Whitespace): " " # (63..64)