File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,7 +32,13 @@ const unstableTests = new Map(
3232
3333// Here we add files that will not have the same AST after being formatted.
3434const unstableAstTests = new Map (
35- [ ] . map ( ( fixture ) => {
35+ [
36+ // `: =` and `= :` are syntactically the same as `:=` and `=:`, but the ast
37+ // changes from `YulColonAndEqual` and `YulEqualAndColon` to `ColonEqual`
38+ // and `EqualColon`, which is expected but the workaround to keep the test
39+ // stable is too much, so we just put it in this list.
40+ "AssemblyV0.4.26/Assembly.sol" ,
41+ ] . map ( ( fixture ) => {
3642 const [ file , isAstUnstable = ( ) => true ] = Array . isArray ( fixture )
3743 ? fixture
3844 : [ fixture ] ;
@@ -72,6 +78,9 @@ const antlrMismatchTests = new Map(
7278 "IndexOf/IndexOf.sol" ,
7379 // Syntax for `pragma solidity 0.5.0 - 0.6.0;` not supported by ANTLR
7480 "Pragma/Pragma.sol" ,
81+ // ANTLR doesn't support assembly assignment operators separated by a space
82+ // like `: =` or `= :`
83+ "AssemblyV0.4.26/Assembly.sol" ,
7584 ] . map ( ( fixture ) => {
7685 const [ file , compareBytecode = ( ) => true ] = Array . isArray ( fixture )
7786 ? fixture
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ contract MultipleAssemblyAssignment {
3939 function foo () public pure {
4040 assembly {
4141 function bar () -> a, b {
42+ b : = 2
4243 a := 1
4344 b := 2
4445 }
@@ -52,6 +53,7 @@ contract AssemblyStackAssignment {
5253 function f () public {
5354 assembly {
5455 4 = : y
56+ 4 = : y
5557 }
5658 }
5759}
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ contract MultipleAssemblyAssignment {
4747 function foo() public pure {
4848 assembly {
4949 function bar() -> a, b {
50+ b : = 2
5051 a := 1
5152 b := 2
5253 }
@@ -60,6 +61,7 @@ contract AssemblyStackAssignment {
6061 function f() public {
6162 assembly {
6263 4 = : y
64+ 4 = : y
6365 }
6466 }
6567}
@@ -108,6 +110,7 @@ contract MultipleAssemblyAssignment {
108110 function foo() public pure {
109111 assembly {
110112 function bar() -> a, b {
113+ b := 2
111114 a := 1
112115 b := 2
113116 }
@@ -122,6 +125,8 @@ contract AssemblyStackAssignment {
122125 assembly {
123126 4
124127 = : y
128+ 4
129+ = : y
125130 }
126131 }
127132}
You can’t perform that action at this time.
0 commit comments