Allow underscores in hex strings.

This commit is contained in:
Daniel Kirchner
2019-09-06 17:58:35 +02:00
parent ea0a952a69
commit 6f3341a204
9 changed files with 56 additions and 5 deletions
@@ -0,0 +1,7 @@
contract C {
function f() public pure {
hex"12__34";
}
}
// ----
// ParserError: (52-60): Invalid use of number separator '_'.
@@ -0,0 +1,7 @@
contract C {
function f() public pure {
hex"_1234";
}
}
// ----
// ParserError: (52-57): Invalid use of number separator '_'.
@@ -0,0 +1,7 @@
contract C {
function f() public pure {
hex"1_234";
}
}
// ----
// ParserError: (52-56): Expected even number of hex-nibbles.
@@ -0,0 +1,7 @@
contract C {
function f() public pure {
hex"1234_";
}
}
// ----
// ParserError: (52-61): Invalid use of number separator '_'.
@@ -0,0 +1,3 @@
contract C {
bytes constant c = hex"12_3456_789012";
}