1
Fork 0

Add StrStyle to ast::LitKind::ByteStr.

This is required to distinguish between cooked and raw byte string
literals in an `ast::LitKind`, without referring to an adjacent
`token::Lit`. It's a prerequisite for the next commit.
This commit is contained in:
Nicholas Nethercote 2022-11-29 13:35:44 +11:00
parent e658144586
commit a7f35c42d4
18 changed files with 39 additions and 28 deletions

View file

@ -361,7 +361,7 @@ impl<'a> ExtCtxt<'a> {
}
pub fn expr_byte_str(&self, sp: Span, bytes: Vec<u8>) -> P<ast::Expr> {
self.expr_lit(sp, ast::LitKind::ByteStr(Lrc::from(bytes)))
self.expr_lit(sp, ast::LitKind::ByteStr(Lrc::from(bytes), ast::StrStyle::Cooked))
}
/// `[expr1, expr2, ...]`