aboutsummaryrefslogtreecommitdiff
path: root/src/makefile/token.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/makefile/token.rs')
-rw-r--r--src/makefile/token.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/makefile/token.rs b/src/makefile/token.rs
index 63c48d9..294e80d 100644
--- a/src/makefile/token.rs
+++ b/src/makefile/token.rs
@@ -134,6 +134,16 @@ impl TokenString {
_ => false,
}
}
+
+ pub fn contains_text(&self, pattern: &str) -> bool {
+ self.0.iter().any(|x| {
+ if let Token::Text(x) = x {
+ x.contains(pattern)
+ } else {
+ false
+ }
+ })
+ }
}
impl fmt::Display for TokenString {