From: Michael Beck Date: Mon, 6 Dec 2004 10:19:47 +0000 (+0000) Subject: ADded support for multiline defines X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=f80cb22323f457e765fd66e4020ceee3c91dc3b6;p=libfirm ADded support for multiline defines [r4566] --- 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)) {