a2d/res/scopecat.pl
2018-02-25 18:40:36 -08:00

15 lines
199 B
Perl
Executable File

#!/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/;
}