This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regen/mph.pl: Add comments to gen'd file
authorKarl Williamson <khw@cpan.org>
Fri, 20 Apr 2018 05:51:32 +0000 (23:51 -0600)
committerKarl Williamson <khw@cpan.org>
Fri, 20 Apr 2018 07:11:54 +0000 (01:11 -0600)
This adds a comment showing for each rule what the input is for it.

regen/mph.pl

index c8eb9fa..e0c84fb 100644 (file)
@@ -259,8 +259,8 @@ sub build_array_of_struct {
         );
         $_ > 0xFF and die "panic: value exceeds range of U8"
             for @u8;
-        push @rows, sprintf("  { %5d, %5d, %5d, %3d, %3d, %s }",
-            @u16, @u8, $row->{value} );
+        push @rows, sprintf("  { %5d, %5d, %5d, %3d, %3d, %s }   /* %s%s */",
+            @u16, @u8, $row->{value}, $row->{prefix}, $row->{suffix});
     }
     return \@rows,\%defines,\%tests;
 }