Skip to content

Commit

Permalink
minimize differences between old and new generated include/parrot/opl…
Browse files Browse the repository at this point in the history
…ib/ops.h
  • Loading branch information
cotto committed Feb 17, 2013
1 parent c66f40d commit cd1fc9d
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions lib/Parrot/Ops2pm.pm
Expand Up @@ -281,7 +281,7 @@ sub prepare_real_ops {
for my $el ( @{ $self->{ops}{OPS} } ) {
next if $el->{CODE} < 0; # skip
my $opname = $el->full_name;
my $n = $self->{optable}{$opname}; # former global
my $n = $self->{optable}{$opname};
if ( $n != $el->{CODE} ) {
die "op $opname: number mismatch: ops.num $n vs. core.ops $el->{CODE}";
}
Expand Down Expand Up @@ -423,6 +423,10 @@ sub print_h {
or die "$self->{script}: Could not open module file '$fullpath' for writing: $!!\n";

print $OUT <<END_C;
#ifndef PARROT_OPLIB_OPS_H_GUARD
#define PARROT_OPLIB_OPS_H_GUARD
/* ex: set ro:
* !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
*
Expand All @@ -432,9 +436,6 @@ sub print_h {
* Any changes made here will be lost!
*/
#ifndef PARROT_OPS_H_GUARD
#define PARROT_OPS_H_GUARD
typedef enum {
END_C

Expand All @@ -445,13 +446,16 @@ END_C
my $comma = $n < @OPS - 1 ? "," : "";
$opname = "PARROT_OP_$opname$comma";

printf $OUT " %-30s\t/* %4d */\n", $opname, $n;
printf $OUT " %-42s /* %d */\n", $opname, $n;
}

print $OUT <<END_C;
} parrot_opcode_enums;
#endif /* PARROT_OPS_H_GUARD */
#endif /* PARROT_OPLIB_OPS_H_GUARD */
END_C

Expand All @@ -460,6 +464,7 @@ END_C
/*
* Local variables:
* c-file-style: "parrot"
* buffer-read-only: t
* End:
* vim: expandtab shiftwidth=4:
*/
Expand Down

0 comments on commit cd1fc9d

Please sign in to comment.