Add "" and `` in string literals.

This commit is contained in:
Stephen Chung
2021-12-09 13:34:51 +08:00
parent d9d44a9683
commit 675ddb89f9
3 changed files with 18 additions and 0 deletions

View File

@@ -1175,6 +1175,15 @@ pub fn parse_string_literal(
result.push(next_char)
}
// Double wrapper
_ if termination_char == next_char
&& escape.is_empty()
&& stream.peek_next().map_or(false, |c| c == termination_char) =>
{
eat_next(stream, pos);
result.push(termination_char)
}
// Close wrapper
_ if termination_char == next_char && escape.is_empty() => {
state.is_within_text_terminated_by = None;