aboutsummaryrefslogtreecommitdiff
path: root/src/makefile/mod.rs
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2021-04-02 20:10:22 -0600
committerMelody Horn <melody@boringcactus.com>2021-04-02 20:10:22 -0600
commit104919da765b1b85aca3246ecdb1a16b71ee6245 (patch)
tree81e68461e7b2a14af49859adadf6ab0fdf14f468 /src/makefile/mod.rs
parentfc56055ecb63ef05b54aa098bde2d3b61c68e8b2 (diff)
downloadmakers-104919da765b1b85aca3246ecdb1a16b71ee6245.tar.gz
makers-104919da765b1b85aca3246ecdb1a16b71ee6245.zip
fucking := operator ruining my line-type detection
Diffstat (limited to 'src/makefile/mod.rs')
-rw-r--r--src/makefile/mod.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/makefile/mod.rs b/src/makefile/mod.rs
index 9c4967a..dfedd97 100644
--- a/src/makefile/mod.rs
+++ b/src/makefile/mod.rs
@@ -45,7 +45,13 @@ impl LineType {
for token in line_tokens.tokens() {
if let Token::Text(text) = token {
let colon_idx = text.find(':');
+ #[cfg(not(feature = "full"))]
let equals_idx = text.find('=');
+ #[cfg(feature = "full")]
+ let equals_idx = ["=", ":=", "::=", "?=", "+="]
+ .iter()
+ .filter_map(|p| text.find(p))
+ .min();
match (colon_idx, equals_idx) {
(Some(_), None) => {
return Self::Rule;
@@ -56,7 +62,7 @@ impl LineType {
(None, Some(_)) => {
return Self::Macro;
}
- (Some(c), Some(e)) if e < c => {
+ (Some(c), Some(e)) if e <= c => {
return Self::Macro;
}
_ => {}