Skip to content

Commit 676c45d

Browse files
authored
lexer: fix dollar quoted string edge case (#691)
1 parent 50a6d1f commit 676c45d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

crates/squawk_lexer/src/lib.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,6 @@ impl Cursor<'_> {
387387
while let Some(c) = self.bump() {
388388
match c {
389389
'$' => {
390-
self.bump();
391390
break;
392391
}
393392
_ => {
@@ -755,4 +754,13 @@ U&"d!0061t!+000061" UESCAPE '!'
755754
"foo "" bar"
756755
"#))
757756
}
757+
758+
#[test]
759+
fn dollar_quoted_string() {
760+
assert_debug_snapshot!(lex("$$$$"), @r#"
761+
[
762+
"$$$$" @ Literal { kind: DollarQuotedString { terminated: true } },
763+
]
764+
"#);
765+
}
758766
}

0 commit comments

Comments
 (0)