Use interpolated token span when building spans for bigger expressions

This commit is contained in:
Florian Hahn 2016-01-24 22:46:39 +01:00
parent 20edb366e7
commit 1bde18d60c
6 changed files with 42 additions and 39 deletions

View file

@ -223,6 +223,14 @@ impl Token {
}
}
/// Returns `true` if the token is interpolated.
pub fn is_interpolated(&self) -> bool {
match *self {
Interpolated(..) => true,
_ => false,
}
}
/// Returns `true` if the token is an interpolated path.
pub fn is_path(&self) -> bool {
match *self {