diff --git a/src/compiler.rs b/src/compiler.rs index 3abfcef..4e07655 100644 --- a/src/compiler.rs +++ b/src/compiler.rs @@ -37,6 +37,7 @@ fn unescape(s: &str) -> String { .replace("\\\"", "\"") .replace("\\\'", "\'") .replace("\\\\", "\\") + .replace("0", "\0") } static BIN_OP_NAMES: LazyLock> = LazyLock::new(|| { diff --git a/src/parser.rs b/src/parser.rs index f9723c7..de0e0a4 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -45,7 +45,7 @@ const NUMBER_START_CHARS: &str = "0123456789"; const NUMBER_CHARS: &str = "0123456789."; const NUMBER_HEX_CHARS: &str = "0123456789ABCDEFabcdef"; const STRING_START_CHARS: &str = "'\""; -const STRING_ESCAPES: &str = "nrt\\\"'"; +const STRING_ESCAPES: &str = "nrt\\\"'0"; //////////////////////////////////////////////////////////////////////////////// // Lexer