diff options
author | Melody Horn <melody@boringcactus.com> | 2021-04-05 11:49:14 -0600 |
---|---|---|
committer | Melody Horn <melody@boringcactus.com> | 2021-04-05 11:49:14 -0600 |
commit | c7b5ea27156b68971d1fc46935e9e5b63243b9ba (patch) | |
tree | d79c5ab47fbd1fa9f8039e479d67c4e24ab79a4f | |
parent | b5c3132edbee5e80292c7e3a976bd1bd73d0c420 (diff) | |
download | makers-c7b5ea27156b68971d1fc46935e9e5b63243b9ba.tar.gz makers-c7b5ea27156b68971d1fc46935e9e5b63243b9ba.zip |
give context for eagerly-expanded macro definition errors
-rw-r--r-- | src/makefile/input.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/makefile/input.rs b/src/makefile/input.rs index 3fe28e7..3707aef 100644 --- a/src/makefile/input.rs +++ b/src/makefile/input.rs @@ -265,6 +265,14 @@ impl<'a, 'parent, R: BufRead> MakefileReader<'a, 'parent, R> { LineType::Macro => self.read_macro(line_tokens, line_number)?, LineType::Unknown => { if !line_tokens.is_empty() { + #[cfg(feature = "full")] + if line_tokens.starts_with("export") { + log::error!("export directive not supported yet"); + continue; + } else if line_tokens.starts_with("unexport") { + log::error!("unexport directive not supported yet"); + continue; + } bail!( "error: line {}: unknown line \"{}\"", line_number, @@ -562,7 +570,10 @@ impl<'a, 'parent, R: BufRead> MakefileReader<'a, 'parent, R> { value.trim_start(); let value = if expand_value { - TokenString::text(self.expand_macros(&value)?) + TokenString::text( + self.expand_macros(&value) + .wrap_err_with(|| format!("while defining {} on line {}", name, line_number))?, + ) } else { value }; |