From: Nathaniel Wesley Filardo Date: Mon, 16 Feb 2015 05:24:47 +0000 (-0500) Subject: Fix make-skeleton.pl X-Git-Url: https://hydra-www.ietfng.org/gitweb/?a=commitdiff_plain;h=a7fbdd80e189420867d2d124244bca0fc1dca129;p=grade Fix make-skeleton.pl --- diff --git a/make-skeleton.pl b/make-skeleton.pl old mode 100644 new mode 100755 index cd1362e..9226b8b --- a/make-skeleton.pl +++ b/make-skeleton.pl @@ -14,6 +14,8 @@ sub comments() { } while(my $line = ) { + chomp $line; + # @section directive? if ($line =~ /^@(\S+)\s/) { comments() if defined $section; @@ -25,14 +27,19 @@ while(my $line = ) { elsif ($line =~ /^(:\S+)\s+/) { die "Directive not within section" if not defined $section; print "#$1\n"; + while (my $cline = ) { chomp $cline; last if $cline eq "."; } } # "#..." and not "#!..." get passed to template - elsif ($line =~ /^#(?!#)/) { - print $line; + elsif ($line =~ /^\s*#/) { + if ($line !~ /^\s*#!/) { + print "$line\n"; + } } - else { die "Unknown line in definition file"; } + elsif ($line =~ /^\s*$/) { ; } + + else { die "Unknown line in definition file ($line)"; } } die "No sections encountered" if not defined $section;