source: branches/help/GDEHELP/cleanmenu.pl

Last change on this file was 8806, checked in by westram, 12 years ago
  • cooked my own preprocessor for ARB_GDEmenus generation
  • intermediate checkin:
    • uses two methods to generate ARB_GDEmenus
    • compares results and fails on difference. Branch from here, if own pp needs changes
  • Property svn:executable set to *
File size: 318 bytes
Line 
1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6my $line;
7my $lastWasEmpty = 1;
8while (defined ($line=<>)) {
9  if ($line =~ /^[#]\s*[0-9]/o) { ; }
10  elsif ($line eq "\n") {
11    if ($lastWasEmpty) { ; }
12    else {
13      print $line;
14      $lastWasEmpty = 1;
15    }
16  }
17  else {
18    print $line;
19    $lastWasEmpty = 0;
20  }
21}
Note: See TracBrowser for help on using the repository browser.