Skip to content

Commit

Permalink
srclines: added support for .dasc files (DynASM source files); also s…
Browse files Browse the repository at this point in the history
…trip the code within #if (DDEBUG) and #endif.
  • Loading branch information
agentzh committed Jan 19, 2013
1 parent 37ff4c1 commit fe0cb6b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions srclines
Expand Up @@ -22,11 +22,16 @@ for my $file (@ARGV) {
$src =~ s/^\s+--.*//gm; $src =~ s/^\s+--.*//gm;
$src =~ s/^\s*\n//gm; $src =~ s/^\s*\n//gm;


} elsif ($ext =~ /^(?:[ch]|cc|cpp|y)$/) { } elsif ($ext =~ /^(?:[ch]|cc|cpp|y|dasc)$/) {
$src =~ s{^\#[ \t]*if[ \t]+(?:0|\(?NGX_DEBUG\)?)[ \t]*\n.*?\n\#endif\b.*?\n}{}gms; $src =~ s{^\#[ \t]*if[ \t]+(?:0|\(?(?:DDEBUG|NGX_DEBUG)\)?)[ \t]*\n.*?\n\#endif\b.*?\n}{}gms;
$src =~ s{/\*.*?\*/}{}gs; $src =~ s{/\*.*?\*/}{}gs;
$src =~ s{//[^\n]*}{}gs; $src =~ s{//[^\n]*}{}gs;
$src =~ s{^\s*dd\(".*\n}{}gm; $src =~ s{^\s*dd\(".*\n}{}gm;

if ($ext eq 'dasc') {
$src =~ s/^[ \t]*\|[ \t]*$//mgs;
}

$src =~ s/^\s*\n//gm; $src =~ s/^\s*\n//gm;


} else { } else {
Expand Down

0 comments on commit fe0cb6b

Please sign in to comment.