File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -797,6 +797,10 @@ pub const Tokenizer = struct {
797
797
remaining_code_units = 3 ;
798
798
state = .char_literal_unicode ;
799
799
},
800
+ '\n ' = > {
801
+ result .tag = .invalid ;
802
+ break ;
803
+ },
800
804
else = > {
801
805
state = .char_literal_end ;
802
806
},
@@ -1507,6 +1511,20 @@ test "tokenizer - code point literal with hex escape" {
1507
1511
, &.{ .invalid , .invalid });
1508
1512
}
1509
1513
1514
+ test "tokenizer - newline in char literal" {
1515
+ try testTokenize (
1516
+ \\'
1517
+ \\'
1518
+ , &.{ .invalid , .invalid });
1519
+ }
1520
+
1521
+ test "tokenizer - newline in string literal" {
1522
+ try testTokenize (
1523
+ \\"
1524
+ \\"
1525
+ , &.{ .invalid , .string_literal });
1526
+ }
1527
+
1510
1528
test "tokenizer - code point literal with unicode escapes" {
1511
1529
// Valid unicode escapes
1512
1530
try testTokenize (
You can’t perform that action at this time.
0 commit comments