diff options
Diffstat (limited to 'src/makefile')
-rw-r--r-- | src/makefile/mod.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/makefile/mod.rs b/src/makefile/mod.rs index 9038150..9c4967a 100644 --- a/src/makefile/mod.rs +++ b/src/makefile/mod.rs @@ -225,12 +225,21 @@ impl<'a> Makefile<'a> { let line_type = LineType::of(&line_tokens); + // before we actually test it, see if it's only visible after expanding macros + let (line_tokens, line_type) = if let LineType::Unknown = line_type { + let line_tokens = TokenString::text(self.expand_macros(&line_tokens, None)?); + let line_type = LineType::of(&line_tokens); + (line_tokens, line_type) + } else { + (line_tokens, line_type) + }; + match line_type { LineType::Rule => self.read_rule(&line_tokens, line_number, &mut lines_iter)?, LineType::Macro => self.read_macro(&line_tokens, line_number)?, LineType::Unknown => { bail!( - "error: line {}: unknown line {:?}", + "error: line {}: unknown line \"{}\"", line_number, line_tokens ); |