From fe0cb6b6d750f2705d0eef9979c5512b0e5f3cad Mon Sep 17 00:00:00 2001 From: "agentzh (Yichun Zhang)" Date: Sat, 19 Jan 2013 14:28:06 -0800 Subject: [PATCH] srclines: added support for .dasc files (DynASM source files); also strip the code within #if (DDEBUG) and #endif. --- srclines | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/srclines b/srclines index 82e3513..39efcf8 100755 --- a/srclines +++ b/srclines @@ -22,11 +22,16 @@ for my $file (@ARGV) { $src =~ s/^\s+--.*//gm; $src =~ s/^\s*\n//gm; - } elsif ($ext =~ /^(?:[ch]|cc|cpp|y)$/) { - $src =~ s{^\#[ \t]*if[ \t]+(?:0|\(?NGX_DEBUG\)?)[ \t]*\n.*?\n\#endif\b.*?\n}{}gms; + } elsif ($ext =~ /^(?:[ch]|cc|cpp|y|dasc)$/) { + $src =~ s{^\#[ \t]*if[ \t]+(?:0|\(?(?:DDEBUG|NGX_DEBUG)\)?)[ \t]*\n.*?\n\#endif\b.*?\n}{}gms; $src =~ s{/\*.*?\*/}{}gs; $src =~ s{//[^\n]*}{}gs; $src =~ s{^\s*dd\(".*\n}{}gm; + + if ($ext eq 'dasc') { + $src =~ s/^[ \t]*\|[ \t]*$//mgs; + } + $src =~ s/^\s*\n//gm; } else {