]> git.imager.perl.org - imager.git/blobdiff - regops.perl
skip t/x30podlinkcheck.t if Pod::Parser 1.50 not available
[imager.git] / regops.perl
index a6f9b5f5df837098d32620fe57f83e126aba52ce..549244e5a4ba1ece8f486c3bb451bf2f6fa861af 100644 (file)
@@ -44,7 +44,34 @@ while (<IN>) {
   }
 }
 print OUT "\n\@EXPORT = qw(@ops);\n\n";
   }
 }
 print OUT "\n\@EXPORT = qw(@ops);\n\n";
-print OUT Data::Dumper->Dump([\%attr],["*Attr"]);
+# previously we used Data::Dumper, with Sortkeys() 
+# to make sure the generated code only changed when the data
+# changed.  Unfortunately Sortkeys isn't supported in some versions of
+# perl we try to support, so we now generate this manually
+print OUT "%Attr =\n  (\n";
+for my $opname (sort keys %attr) {
+  my $op = $attr{$opname};
+  print OUT "  '$opname' =>\n    {\n";
+  for my $attrname (sort keys %$op) {
+    my $attr = $op->{$attrname};
+    print OUT "    '$attrname' => ";
+    if (defined $attr) {
+      if ($attr =~ /^\d+$/) {
+       print OUT $attr;
+      }
+      else {
+       print OUT "'$attr'";
+      }
+    }
+    else {
+      print OUT "undef";
+    }
+
+    print OUT ",\n";
+  }
+  print OUT "    },\n";
+}
+print OUT "  );\n";
 print OUT "\$MaxOperands = $max_opr;\n";
 print OUT qq/\$PackCode = "$reg_pack";\n/;
 print OUT <<'EOS';
 print OUT "\$MaxOperands = $max_opr;\n";
 print OUT qq/\$PackCode = "$reg_pack";\n/;
 print OUT <<'EOS';
@@ -54,7 +81,7 @@ __END__
 
 =head1 NAME
 
 
 =head1 NAME
 
-Imager::Regops - generated information about the register based VM
+Imager::Regops - generated information about the register based virtual machine
 
 =head1 SYNOPSIS
 
 
 =head1 SYNOPSIS
 
@@ -68,7 +95,7 @@ Imager::Regops - generated information about the register based VM
 
 =head1 DESCRIPTION
 
 
 =head1 DESCRIPTION
 
-This module is generated automatically from regmach.h so we don't need to 
+This module is generated automatically from F<regmach.h> so we don't need to
 maintain the same information in at least one extra place.
 
 At least that's the idea.
 maintain the same information in at least one extra place.
 
 At least that's the idea.
@@ -79,7 +106,7 @@ Tony Cook, tony@develop-help.com
 
 =head1 SEE ALSO
 
 
 =head1 SEE ALSO
 
-perl(1), Imager(3), http://imager.perl.org/~addi/perl/Imager/
+perl(1), Imager(3), http://imager.perl.org/
 
 =cut
 
 
 =cut