mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Allow hex string literals in Yul.
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
{
|
||||
let x := hex"112233445566778899aabbccddeeff6677889900"
|
||||
let y := hex"1234_abcd"
|
||||
sstore(0, x)
|
||||
sstore(1, y)
|
||||
}
|
||||
// ----
|
||||
// Trace:
|
||||
// Memory dump:
|
||||
// Storage dump:
|
||||
// 0000000000000000000000000000000000000000000000000000000000000000: 112233445566778899aabbccddeeff6677889900000000000000000000000000
|
||||
// 0000000000000000000000000000000000000000000000000000000000000001: 1234abcd00000000000000000000000000000000000000000000000000000000
|
||||
@@ -2,4 +2,3 @@
|
||||
let x := hex"0011"
|
||||
}
|
||||
// ----
|
||||
// ParserError 3772: (15-24): Hex literals are not valid in this context.
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
let x := hex"00110011001100110011001100110011001100110011001100110011001100110011001100110011"
|
||||
}
|
||||
// ----
|
||||
// TypeError 3069: (15-100): String literal too long (40 > 32)
|
||||
@@ -2,4 +2,3 @@
|
||||
pop(hex"2233")
|
||||
}
|
||||
// ----
|
||||
// ParserError 3772: (10-19): Hex literals are not valid in this context.
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
let name := hex"abc"
|
||||
}
|
||||
// ====
|
||||
// dialect: evm
|
||||
// ----
|
||||
// ParserError 1465: (18-24): Illegal token: Expected even number of hex-nibbles.
|
||||
@@ -4,4 +4,3 @@
|
||||
case hex"1122" {}
|
||||
}
|
||||
// ----
|
||||
// ParserError 3772: (33-40): Hex literals are not valid in this context.
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
switch codesize()
|
||||
case hex"00" {}
|
||||
case hex"112233445566778899001122334455667788990011223344556677889900112233445566778899001122334455667788990011223344556677889900" {}
|
||||
}
|
||||
// ----
|
||||
// TypeError 3069: (53-178): String literal too long (60 > 32)
|
||||
Reference in New Issue
Block a user