From 52c5c7f8376c42f8ed4702b60754332864daabf3 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Mon, 5 Apr 2021 12:00:13 -0600 Subject: give context for errors when disambiguating a line --- src/makefile/input.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/makefile/input.rs b/src/makefile/input.rs index 316968f..d6cffdf 100644 --- a/src/makefile/input.rs +++ b/src/makefile/input.rs @@ -240,7 +240,11 @@ impl<'a, 'parent, R: BufRead> MakefileReader<'a, 'parent, R> { // 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)?.trim()); + let line_tokens = TokenString::text( + self.expand_macros(&line_tokens) + .wrap_err_with(|| format!("while parsing line {}", line_number))? + .trim(), + ); // and let's eval whatever bullshit needs evaling #[cfg(feature = "full")] { -- cgit v1.2.3