a2d/res/scopecat.pl

15 lines
199 B
Perl
Raw Normal View History

2018-02-26 02:40:36 +00:00
#!/usr/bin/env perl
use strict;
use warnings;
my $depth = 0;
while (<STDIN>) {
++$depth if m/\.proc/ || m/\.scope/;
print "$depth - $_";
--$depth if m/\.endproc/ || m/\.endscope/;
}