File: unpreprocess.pl

package info (click to toggle)
range-v3 0.12.0-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,620 kB
  • sloc: cpp: 76,839; xml: 226; sh: 89; python: 34; makefile: 16; perl: 15
file content (19 lines) | stat: -rwxr-xr-x 303 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/perl

use strict;

my $file = "";
my $first = 1;
my $emit = 0;

while(<>) {
    if ($first) {
        $_ =~ m/^#\s*\d+\s+"(.*)"/;
        $file = $1;
        $first = 0;
    } elsif ($_ =~ m/^#\s*\d+\s+"(.*)"/) {
        $emit = ($1 eq $file);
    } elsif ($emit) {
        print $_;
    }
}