diff options
author | Melody Horn <melody@boringcactus.com> | 2021-04-02 20:10:22 -0600 |
---|---|---|
committer | Melody Horn <melody@boringcactus.com> | 2021-04-02 20:10:22 -0600 |
commit | 104919da765b1b85aca3246ecdb1a16b71ee6245 (patch) | |
tree | 81e68461e7b2a14af49859adadf6ab0fdf14f468 /src | |
parent | fc56055ecb63ef05b54aa098bde2d3b61c68e8b2 (diff) | |
download | makers-104919da765b1b85aca3246ecdb1a16b71ee6245.tar.gz makers-104919da765b1b85aca3246ecdb1a16b71ee6245.zip |
fucking := operator ruining my line-type detection
Diffstat (limited to 'src')
-rw-r--r-- | src/makefile/mod.rs | 8 |
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; } _ => {} |