mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add extra token for assembly assignment
Adding an extra token for := prevents whitespace between : = being valid
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
contract C {
|
||||
function f() public pure {
|
||||
assembly {
|
||||
let mod := 2
|
||||
}
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// ParserError: (67-70): Cannot use instruction names for identifier names.
|
||||
// ParserError: (71-73): Expected ';' but got ':='
|
||||
@@ -7,5 +7,5 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// ParserError: (87-88): Literal, identifier or instruction expected.
|
||||
// ParserError: (87-88): Expected primary expression.
|
||||
// ParserError: (87-89): Literal, identifier or instruction expected.
|
||||
// ParserError: (87-89): Expected primary expression.
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
contract C {
|
||||
function f() public pure {
|
||||
assembly {
|
||||
function g() -> a,b, c {}
|
||||
let a, sub, mov := g()
|
||||
}
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// ParserError: (102-105): Cannot use instruction names for identifier names.
|
||||
// ParserError: (105-106): Expected ';' but got ','
|
||||
@@ -0,0 +1,10 @@
|
||||
contract C {
|
||||
function f() public pure {
|
||||
assembly {
|
||||
return := 1
|
||||
}
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// ParserError: (70-72): Variable name must precede ":=" in assignment.
|
||||
// ParserError: (70-72): Expected primary expression.
|
||||
@@ -0,0 +1,10 @@
|
||||
contract C {
|
||||
function f() public pure {
|
||||
assembly {
|
||||
return : 1
|
||||
}
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// ParserError: (70-71): Label name must precede ":".
|
||||
// ParserError: (70-71): Expected primary expression.
|
||||
@@ -0,0 +1,10 @@
|
||||
contract C {
|
||||
function f() public pure {
|
||||
assembly {
|
||||
let x : = mload(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// ParserError: (69-70): Literal, identifier or instruction expected.
|
||||
// ParserError: (69-70): Expected primary expression.
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
contract C {
|
||||
function f() public pure {
|
||||
assembly {
|
||||
function g() -> a,b, c {}
|
||||
let x, y ,z : = g()
|
||||
}
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// ParserError: (107-108): Literal, identifier or instruction expected.
|
||||
// ParserError: (107-108): Expected primary expression.
|
||||
Reference in New Issue
Block a user