aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKyle Clemens <github@kyleclemens.com>2019-10-15 13:45:17 +0000
committerAlex Crichton <alex@alexcrichton.com>2019-10-15 08:45:17 -0500
commit2a6729f543a3e8b0e1a24f33a5fa93fd8b285440 (patch)
tree7e46cab6da1d01678b5ecd487738d40cd49a05eb /src
parente457e4eb33232e253866df9e6a736134bad2b38c (diff)
downloadmilf-rs-2a6729f543a3e8b0e1a24f33a5fa93fd8b285440.tar.gz
milf-rs-2a6729f543a3e8b0e1a24f33a5fa93fd8b285440.zip
feat: support tabs in basic strings (#343)
Close #310.
Diffstat (limited to 'src')
-rw-r--r--src/tokens.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tokens.rs b/src/tokens.rs
index 91824c5..49265fb 100644
--- a/src/tokens.rs
+++ b/src/tokens.rs
@@ -415,7 +415,7 @@ impl<'a> Tokenizer<'a> {
}
Ok(())
}
- ch if '\u{20}' <= ch && ch <= '\u{10ffff}' && ch != '\u{7f}' => {
+ ch if ch == '\u{09}' || ('\u{20}' <= ch && ch <= '\u{10ffff}' && ch != '\u{7f}') => {
val.push(ch);
Ok(())
}
@@ -617,6 +617,8 @@ mod tests {
t(r#""\U00000000""#, "\0", false);
t(r#""\U000A0000""#, "\u{A0000}", false);
t(r#""\\t""#, "\\t", false);
+ t("\"\t\"", "\t", false);
+ t("\"\"\"\n\t\"\"\"", "\t", true);
t("\"\"\"\\\n\"\"\"", "", true);
t(
"\"\"\"\\\n \t \t \\\r\n \t \n \t \r\n\"\"\"",