diff options
author | Melody Horn <melody@boringcactus.com> | 2021-04-02 20:37:54 -0600 |
---|---|---|
committer | Melody Horn <melody@boringcactus.com> | 2021-04-02 20:37:54 -0600 |
commit | 441b137307ba5fbc22d0d32dca6e5c0f9559dbf5 (patch) | |
tree | 67c43c4ee2d9cf95fea2f5902eade86d7a6ae385 /src/makefile/token.rs | |
parent | 8b70f19427db3307135b4d8b2a7bca31fc1d1a71 (diff) | |
download | makers-441b137307ba5fbc22d0d32dca6e5c0f9559dbf5.tar.gz makers-441b137307ba5fbc22d0d32dca6e5c0f9559dbf5.zip |
implement define blocks
Diffstat (limited to 'src/makefile/token.rs')
-rw-r--r-- | src/makefile/token.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/makefile/token.rs b/src/makefile/token.rs index 271580a..3bb9f4e 100644 --- a/src/makefile/token.rs +++ b/src/makefile/token.rs @@ -63,7 +63,6 @@ impl TokenString { None } - #[cfg(feature = "full")] pub fn starts_with(&self, pattern: &str) -> bool { match self.0.first() { Some(Token::Text(t)) => t.starts_with(pattern), @@ -78,7 +77,6 @@ impl TokenString { } } - #[cfg(feature = "full")] pub fn strip_prefix(&mut self, suffix: &str) { if let Some(Token::Text(t)) = self.0.first_mut() { if let Some(x) = t.strip_prefix(suffix) { @@ -105,7 +103,6 @@ impl TokenString { } } - #[cfg(feature = "full")] pub fn trim_end(&mut self) { if let Some(Token::Text(t)) = self.0.last_mut() { *t = t.trim_end().into(); @@ -115,7 +112,7 @@ impl TokenString { pub fn is_empty(&self) -> bool { match self.0.get(0) { None => true, - Some(Token::Text(t)) if t.is_empty() => true, + Some(Token::Text(t)) if t.is_empty() && self.0.len() == 1 => true, _ => false, } } |