aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2021-06-08 14:15:25 +1000
committerDavid Gibson <david@gibson.dropbear.id.au>2021-06-08 14:15:25 +1000
commite59ca36fb70e32f8b4850135ab94fdf44cd22557 (patch)
treea557b0f37ed4297d80de9e2b0a3ceb5be2ca02d4
parent0c3fd9b6acebc980e5e881385afd265fa7665270 (diff)
downloaddtc-e59ca36fb70e32f8b4850135ab94fdf44cd22557.zip
dtc-e59ca36fb70e32f8b4850135ab94fdf44cd22557.tar.gz
dtc-e59ca36fb70e32f8b4850135ab94fdf44cd22557.tar.bz2
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 <david@gibson.dropbear.id.au>
-rw-r--r--dtc-lexer.l2
1 files changed, 1 insertions, 1 deletions
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 # */