[svn:parrot] r42591 - trunk/config/gen
jkeenan at svn.parrot.org
jkeenan at svn.parrot.org
Fri Nov 20 02:32:28 UTC 2009
Author: jkeenan
Date: Fri Nov 20 02:32:28 2009
New Revision: 42591
URL: https://trac.parrot.org/parrot/changeset/42591
Log:
Correct two cases where subroutine calls could be interpreted incorrectly (chromatic++). Put subs in order more consistent with other config step classes.
Modified:
trunk/config/gen/parrot_include.pm
Modified: trunk/config/gen/parrot_include.pm
==============================================================================
--- trunk/config/gen/parrot_include.pm Fri Nov 20 02:20:24 2009 (r42590)
+++ trunk/config/gen/parrot_include.pm Fri Nov 20 02:32:28 2009 (r42591)
@@ -56,6 +56,56 @@
return \%data;
}
+sub runstep {
+ my ( $self, $conf ) = @_;
+ my $verbose = $conf->options->get('verbose');
+
+ # need vtable.h now
+ system( $^X, "tools/build/vtable_h.pl" );
+
+ my @generated;
+ for my $file ( @{ $self->{source_files} }, @{ $self->{generated_files} } ) {
+ open my $fh, '<', $file or die "Can't open $file: $!\n";
+ my @directives = parse_file($file, $fh);
+ close $fh;
+ for my $d (@directives) {
+ my @defs = perform_directive($d);
+ for my $target ( @{ $d->{files} } ) {
+ $verbose and print "$target ";
+ my $gen;
+ if ( $target =~ /\.pm$/ ) {
+ $gen = join "\n", &const_to_perl(@defs);
+ $gen .= "\n1;";
+ }
+ else {
+ $gen = join "\n", &const_to_parrot(@defs);
+ }
+ $conf->append_configure_log(qq{$self->{destdir}/$target});
+ my $target_tmp = "$target.tmp";
+ open my $out, '>', $target_tmp or die "Can't open $target_tmp: $!\n";
+
+ print $out <<"EOF";
+# DO NOT EDIT THIS FILE.
+#
+# This file is generated automatically from
+# $file by config/gen/parrot_include.pm
+#
+# Any changes made here will be lost.
+#
+$gen
+EOF
+ close $out or die "Can't write $target_tmp: $!\n";
+ $target =~ m[/] or $target = "$self->{destdir}/$target";
+ move_if_diff( $target_tmp, $target );
+ push @generated, $target;
+ }
+ }
+ }
+ $conf->data->set( TEMP_gen_pasm_includes => join( " \\\n ", @generated ) );
+
+ return 1;
+}
+
sub const_to_parrot {
map ".macro_const $_->[0]\t$_->[1]", @_;
}
@@ -181,56 +231,6 @@
return @d;
}
-sub runstep {
- my ( $self, $conf ) = @_;
- my $verbose = $conf->options->get('verbose');
-
- # need vtable.h now
- system( $^X, "tools/build/vtable_h.pl" );
-
- my @generated;
- for my $file ( @{ $self->{source_files} }, @{ $self->{generated_files} } ) {
- open my $fh, '<', $file or die "Can't open $file: $!\n";
- my @directives = parse_file $file, $fh;
- close $fh;
- for my $d (@directives) {
- my @defs = perform_directive $d;
- for my $target ( @{ $d->{files} } ) {
- $verbose and print "$target ";
- my $gen;
- if ( $target =~ /\.pm$/ ) {
- $gen = join "\n", &const_to_perl(@defs);
- $gen .= "\n1;";
- }
- else {
- $gen = join "\n", &const_to_parrot(@defs);
- }
- $conf->append_configure_log(qq{$self->{destdir}/$target});
- my $target_tmp = "$target.tmp";
- open my $out, '>', $target_tmp or die "Can't open $target_tmp: $!\n";
-
- print $out <<"EOF";
-# DO NOT EDIT THIS FILE.
-#
-# This file is generated automatically from
-# $file by config/gen/parrot_include.pm
-#
-# Any changes made here will be lost.
-#
-$gen
-EOF
- close $out or die "Can't write $target_tmp: $!\n";
- $target =~ m[/] or $target = "$self->{destdir}/$target";
- move_if_diff( $target_tmp, $target );
- push @generated, $target;
- }
- }
- }
- $conf->data->set( TEMP_gen_pasm_includes => join( " \\\n ", @generated ) );
-
- return 1;
-}
-
1;
# Local Variables:
More information about the parrot-commits
mailing list