aboutsummaryrefslogtreecommitdiff
path: root/src/makefile/token.rs
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2021-04-02 20:11:50 -0600
committerMelody Horn <melody@boringcactus.com>2021-04-02 20:11:50 -0600
commitaa017eb4dc9f070c35711fdf908171938921c422 (patch)
tree2ef87ddf72702d1adbdcc2038c762036aada43ab /src/makefile/token.rs
parent104919da765b1b85aca3246ecdb1a16b71ee6245 (diff)
downloadmakers-aa017eb4dc9f070c35711fdf908171938921c422.tar.gz
makers-aa017eb4dc9f070c35711fdf908171938921c422.zip
ignore macro-expanded-to-empty lines
Diffstat (limited to 'src/makefile/token.rs')
-rw-r--r--src/makefile/token.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/makefile/token.rs b/src/makefile/token.rs
index 8bd0179..271580a 100644
--- a/src/makefile/token.rs
+++ b/src/makefile/token.rs
@@ -111,6 +111,14 @@ impl TokenString {
*t = t.trim_end().into();
}
}
+
+ pub fn is_empty(&self) -> bool {
+ match self.0.get(0) {
+ None => true,
+ Some(Token::Text(t)) if t.is_empty() => true,
+ _ => false,
+ }
+ }
}
impl fmt::Display for TokenString {