File: preproc.pl

package info (click to toggle)
meep 0.10-2.1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 4,380 kB
  • ctags: 5,469
  • sloc: cpp: 50,653; sh: 8,380; haskell: 744; makefile: 367; perl: 10
file content (13 lines) | stat: -rw-r--r-- 244 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/perl -w

my $amcode = 0;

while (<>) {
  if ($amcode && /^(\\end\{comment\}|\\end\{verbatim\})$/) {
    $amcode = 0
  } elsif ($amcode) {
    print $_;
  } elsif (/^(\\begin\{comment\}|\\begin\{verbatim\})$/) {
    $amcode = 1;
  }
}