From f80cb22323f457e765fd66e4020ceee3c91dc3b6 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Mon, 6 Dec 2004 10:19:47 +0000 Subject: [PATCH] ADded support for multiline defines [r4566] --- tools/remove_cpp_comands.perl | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tools/remove_cpp_comands.perl b/tools/remove_cpp_comands.perl index 56a8c2a24..759772022 100644 --- a/tools/remove_cpp_comands.perl +++ b/tools/remove_cpp_comands.perl @@ -62,6 +62,7 @@ $scndlastline = ""; $lastline = ""; $eat = 0; +$multiline = 0; foreach $line (@lines) { @@ -71,10 +72,22 @@ foreach $line (@lines) { $eat = 2; } elsif ($eat > 0) { $eat = $eat -1; - } elsif (($line =~ /^\#/) ) { + } elsif ($multiline > 0) { + # this line connects a previous one, kill it + if ($line =~ /\\$/) { + $multiline = 1; + } else { + $multiline = 0; + } + } elsif ($line =~ /^\#/) { # eat the line $scndlastline = $lastline; $lastline = $line; + if ($line =~ /\\$/) { + $multiline = 1; + } else { + $multiline = 0; + } } elsif ($openbracket == 1) { print TDF "$line"; if ((index($line, "}") > -1)) { -- 2.20.1