diff --git a/trunk_lexer/src/lexer.rs b/trunk_lexer/src/lexer.rs index 366c332..5bba1c4 100644 --- a/trunk_lexer/src/lexer.rs +++ b/trunk_lexer/src/lexer.rs @@ -202,10 +202,18 @@ impl Lexer { self.next(); self.tokenize_single_quote_string()? } + [b'b' | b'B', b'\'', ..] => { + self.skip(2); + self.tokenize_single_quote_string()? + } [b'"', ..] => { self.next(); self.tokenize_double_quote_string()? } + [b'b' | b'B', b'"', ..] => { + self.skip(2); + self.tokenize_double_quote_string()? + } [b'$', ..] => { self.next(); self.tokenize_variable() @@ -909,6 +917,18 @@ string.'"#, ); } + #[test] + fn binary_strings() { + assert_tokens( + r#"