2017-11-16 23:30:08 -08:00
|
|
|
use common::*;
|
|
|
|
|
|
|
|
#[derive(PartialEq, Debug)]
|
|
|
|
pub enum Fragment<'a> {
|
2018-12-08 14:29:41 -08:00
|
|
|
Text { text: Token<'a> },
|
|
|
|
Expression { expression: Expression<'a> },
|
2017-11-16 23:30:08 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
impl<'a> Fragment<'a> {
|
|
|
|
pub fn continuation(&self) -> bool {
|
|
|
|
match *self {
|
2018-12-08 14:29:41 -08:00
|
|
|
Fragment::Text { ref text } => text.lexeme.ends_with('\\'),
|
2017-11-16 23:30:08 -08:00
|
|
|
_ => false,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|