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

@ -323,7 +323,8 @@ impl<'a> State<'a> {
self.print_token_literal(*token_lit, expr.span);
}
ast::ExprKind::IncludedBytes(bytes) => {
let lit = ast::LitKind::ByteStr(bytes.clone()).synthesize_token_lit();
let lit = ast::LitKind::ByteStr(bytes.clone(), ast::StrStyle::Cooked)
.synthesize_token_lit();
self.print_token_literal(lit, expr.span)
}
ast::ExprKind::Cast(expr, ty) => {