From b98e68d3ba7575e147856e0ec6b85869b7c273e0 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Tue, 13 Apr 2021 22:14:48 -0600 Subject: prefer a full-line comment to a partial-line comment given the choice --- src/makefile/input.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/makefile/input.rs b/src/makefile/input.rs index e2bff65..e88314d 100644 --- a/src/makefile/input.rs +++ b/src/makefile/input.rs @@ -408,7 +408,7 @@ impl<'a, 'parent, R: BufRead> MakefileReader<'a, 'parent, R> { fn next_line(&mut self, settings: NextLineSettings) -> Option<(usize, Result)> { lazy_static! { - static ref COMMENT: Regex = Regex::new(r"([^\\]|^)#.*$").unwrap(); + static ref COMMENT: Regex = Regex::new(r"(^|[^\\])#.*$").unwrap(); } let escaped_newline_replacement = settings.escaped_newline_replacement; if let Some((line_number, line)) = self.pending_line.take() { -- cgit v1.2.3