From e59ca36fb70e32f8b4850135ab94fdf44cd22557 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Tue, 8 Jun 2021 14:15:25 +1000 Subject: [PATCH] Make handling of cpp line information more tolerant At least some cpp implementations, in at least some circumstances place multiple numbers after the file name when they put line number information into the output. We don't really care what the content of these is, but we want the dtc lexer not to choke on this, so adjust the rule for handling cpp line number information accordingly. Signed-off-by: David Gibson --- dtc-lexer.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dtc-lexer.l b/dtc-lexer.l index b3b7270..5568b4a 100644 --- a/dtc-lexer.l +++ b/dtc-lexer.l @@ -57,7 +57,7 @@ static void PRINTF(1, 2) lexical_error(const char *fmt, ...); push_input_file(name); } -<*>^"#"(line)?[ \t]+[0-9]+[ \t]+{STRING}([ \t]+[0-9]+)? { +<*>^"#"(line)?[ \t]+[0-9]+[ \t]+{STRING}([ \t]+[0-9]+)* { char *line, *fnstart, *fnend; struct data fn; /* skip text before line # */