stage2: Allow \t in string literals

Lift the ban on literal tab chars in string literals as they have
nothing to do with code formatting.
master
LemonBoy 2020-04-22 09:02:03 +02:00 committed by Andrew Kelley
parent 48dc3b6fe9
commit 0a2519fafb
1 changed files with 9 additions and 0 deletions

View File

@ -848,6 +848,7 @@ pub const Tokenizer = struct {
self.index += 1;
break;
},
'\t' => {},
else => self.checkLiteralCharacter(),
},
@ -1687,6 +1688,14 @@ test "tokenizer - string identifier and builtin fns" {
});
}
test "tokenizer - multiline string literal with literal tab" {
testTokenize(
\\\\foo bar
, &[_]Token.Id{
Token.Id.MultilineStringLiteralLine,
});
}
test "tokenizer - pipe and then invalid" {
testTokenize("||=", &[_]Token.Id{
Token.Id.PipePipe,