Change 13355 by jhi@alpha on 2001/11/29 04:43:54

        Subject: Re: More h2ph problems [was Re: h2ph confused by comments in an enum.
        From: Hugo van der Sanden <[EMAIL PROTECTED]>                 
        Date: Wed, 28 Nov 2001 21:47:59 +0000
        Message-Id: <[EMAIL PROTECTED]>

Affected files ...

.... //depot/perl/t/lib/h2ph.h#5 edit
.... //depot/perl/t/lib/h2ph.pht#8 edit
.... //depot/perl/utils/h2ph.PL#28 edit

Differences ...

==== //depot/perl/t/lib/h2ph.h#5 (text) ====
Index: perl/t/lib/h2ph.h
--- perl/t/lib/h2ph.h.~1~       Wed Nov 28 22:00:05 2001
+++ perl/t/lib/h2ph.h   Wed Nov 28 22:00:05 2001
@@ -98,6 +98,13 @@
 ??= define SOMETHING_ELSE_TRIGRAPHIC_8 "??>"          /* | ??>|  }| */
        ??=endif
 
+// test C++-style comment
+
+#if 1
+typdef struct empty_struct {
+} // trailing C++-style comment should not force continuation
+#endif
+
 /* comments (that look like string) inside enums... */
 
 enum {

==== //depot/perl/t/lib/h2ph.pht#8 (text) ====
Index: perl/t/lib/h2ph.pht
--- perl/t/lib/h2ph.pht.~1~     Wed Nov 28 22:00:05 2001
+++ perl/t/lib/h2ph.pht Wed Nov 28 22:00:05 2001
@@ -79,6 +79,8 @@
        eval 'sub SOMETHING_ELSE_TRIGRAPHIC_7 () {"#";}' unless 
defined(&SOMETHING_ELSE_TRIGRAPHIC_7);
        eval 'sub SOMETHING_ELSE_TRIGRAPHIC_8 () {"}";}' unless 
defined(&SOMETHING_ELSE_TRIGRAPHIC_8);
     }
+    if(1) {
+    }
     eval("sub flim () { 0; }") unless defined(&flim);
     eval("sub flam () { 1; }") unless defined(&flam);
 }

==== //depot/perl/utils/h2ph.PL#28 (text) ====
Index: perl/utils/h2ph.PL
--- perl/utils/h2ph.PL.~1~      Wed Nov 28 22:00:05 2001
+++ perl/utils/h2ph.PL  Wed Nov 28 22:00:05 2001
@@ -438,7 +438,7 @@
             } elsif ($in =~ s/^("(\\.|[^"\\])*")//) {       # "...
                 $out    .= $1;
             } elsif ($in =~ s/^\/\/.*//) {                  # //...
-                next READ;
+                # fall through
             } elsif ($in =~ m/^\/\*/) {                     # /*...
                 # C comment removal adapted from perlfaq6:
                 if ($in =~ s/^\/\*[^*]*\*+([^\/*][^*]*\*+)*\///) {
@@ -455,7 +455,7 @@
             }
         }
 
-        last READ;
+        last READ if $out =~ /\S/;
     }
 
     return $out;
End of Patch.

Reply via email to