just/src/string_literal.rs

21 lines
406 B
Rust
Raw Normal View History

use crate::common::*;
2017-11-16 23:30:08 -08:00
2021-06-08 01:01:27 -07:00
#[derive(PartialEq, Debug, Clone)]
pub(crate) struct StringLiteral<'src> {
pub(crate) kind: StringKind,
pub(crate) raw: &'src str,
pub(crate) cooked: String,
2017-11-16 23:30:08 -08:00
}
impl Display for StringLiteral<'_> {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
write!(
f,
"{}{}{}",
self.kind.delimiter(),
self.raw,
self.kind.delimiter()
)
}
}