Remove the \b, \f, \v escape sequences from the Scanner

This commit is contained in:
Alex Beregszaszi
2020-12-07 21:10:03 +00:00
parent 933f4db798
commit 66ee3ec533
8 changed files with 45 additions and 13 deletions
@@ -0,0 +1,10 @@
contract test {
function f() public pure returns (bytes32) {
bytes32 escapeCharacters = "\t\n\r\'\"\\";
return escapeCharacters;
}
}
// ====
// compileViaYul: also
// ----
// f() -> 0x090a0d27225c0000000000000000000000000000000000000000000000000000
@@ -0,0 +1,8 @@
contract test {
function f() public pure returns (bytes32) {
bytes32 escapeCharacters = "\t\b\f";
return escapeCharacters;
}
}
// ----
// ParserError 8936: (100-105): Invalid escape sequence.
@@ -1,6 +1,6 @@
contract test {
function f() public pure returns (bytes32) {
bytes32 escapeCharacters = "\t\b\n\r\f\'\"\\\b";
bytes32 escapeCharacters = "\n\r\'\"\\";
return escapeCharacters;
}
}