From 104919da765b1b85aca3246ecdb1a16b71ee6245 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Fri, 2 Apr 2021 20:10:22 -0600 Subject: fucking := operator ruining my line-type detection --- src/makefile/mod.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/makefile') 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; } _ => {} -- cgit v1.2.3