Re: h2ph confused by comments in an enum.
Hugo van der Sanden [Wed, 28 Nov 2001 04:19:21 +0000 (04:19 +0000)]
Date: Wed, 28 Nov 2001 04:19:21 +0000
Message-Id: <200111280419.fAS4JLD17887@crypt.compulink.co.uk>

Subject: Re: More h2ph problems [was Re: h2ph confused by comments in an enum.]
From: Hugo van der Sanden <hv@crypt.compulink.co.uk>
Date: Wed, 28 Nov 2001 13:36:35 +0000
Message-Id: <200111281336.fASDaZG30245@crypt.compulink.co.uk>

p4raw-id: //depot/perl@13338

utils/h2ph.PL

index 9082e14..4dab916 100644 (file)
@@ -240,7 +240,7 @@ while (defined (my $file = next_file())) {
            }
        } elsif(/^\s*(typedef\s*)?enum\s*(\s+[a-zA-Z_]\w*\s*)?/) {
            until(/\{[^}]*\}.*;/ || /;/) {
-               last unless defined ($next = <IN>);
+               last unless defined ($next = next_line());
                chomp $next;
                # drop "#define FOO FOO" in enums
                $next =~ s/^\s*#\s*define\s+(\w+)\s+\1\s*$//;
@@ -438,7 +438,7 @@ sub next_line
             } elsif ($in =~ s/^("(\\.|[^"\\])*")//) {       # "...
                 $out    .= $1;
             } elsif ($in =~ s/^\/\/.*//) {                  # //...
-                last READ;
+                next READ;
             } elsif ($in =~ m/^\/\*/) {                     # /*...
                 # C comment removal adapted from perlfaq6:
                 if ($in =~ s/^\/\*[^*]*\*+([^\/*][^*]*\*+)*\///) {