Merge pull request #9555 from ethereum/yul-parser-refactor

Yul parser refactor
This commit is contained in:
chriseth
2020-12-03 18:07:31 +01:00
committed by GitHub
15 changed files with 56 additions and 78 deletions
@@ -7,4 +7,4 @@ contract C {
}
}
// ----
// ParserError 2314: (118-119): Expected '(' but got '}'
// ParserError 7104: (104-109): Builtin function "mload" must be called.
@@ -7,4 +7,4 @@ contract C {
}
}
// ----
// ParserError 2314: (101-103): Expected '(' but got ':='
// ParserError 6272: (101-103): Cannot assign to builtin function "mload".
@@ -7,4 +7,4 @@ contract C {
}
}
// ----
// ParserError 2314: (95-98): Expected '(' but got identifier
// ParserError 6913: (95-98): Call or assignment expected.
@@ -6,4 +6,4 @@ contract test {
}
}
// ----
// ParserError 2314: (85-86): Expected '(' but got '}'
// ParserError 6913: (85-86): Call or assignment expected.
@@ -2,4 +2,4 @@
function f(x) { f(add) }
}
// ----
// ParserError 2314: (24-25): Expected '(' but got ')'
// ParserError 7104: (21-24): Builtin function "add" must be called.
@@ -1,6 +1,5 @@
{
// Test for the unreachable 6272_error
add := 1
}
// ----
// ParserError 2314: (47-49): Expected '(' but got ':='
// ParserError 6272: (7-9): Cannot assign to builtin function "add".
@@ -1,7 +1,6 @@
{
// Test for the unreachable 6272_error
function f() -> a, b {}
add, mul := f()
}
// ----
// ParserError 2314: (71-72): Expected '(' but got ','
// ParserError 6272: (31-32): Cannot assign to builtin function "add".
@@ -2,4 +2,4 @@
for {} mload {} {}
}
// ----
// ParserError 2314: (16-17): Expected '(' but got '{'
// ParserError 7104: (10-15): Builtin function "mload" must be called.
@@ -2,4 +2,4 @@
let x := byte
}
// ----
// ParserError 2314: (20-21): Expected '(' but got '}'
// ParserError 7104: (15-19): Builtin function "byte" must be called.
@@ -2,4 +2,4 @@
if mload {}
}
// ----
// ParserError 2314: (15-16): Expected '(' but got '{'
// ParserError 7104: (9-14): Builtin function "mload" must be called.
@@ -2,4 +2,4 @@
if calldatasize {}
}
// ----
// ParserError 2314: (22-23): Expected '(' but got '{'
// ParserError 7104: (9-21): Builtin function "calldatasize" must be called.
@@ -4,4 +4,4 @@
default {}
}
// ----
// ParserError 2314: (23-27): Expected '(' but got reserved keyword 'case'
// ParserError 7104: (13-18): Builtin function "mload" must be called.