With this version of imcc, some typo fixes in tests and the assemble.pl below all parrot tests except t/op/interp_1 succeed, when assembled by imcc.
The failing test is probably due to the global interpreter var, that imcc has.

Nice to would have:
- some more environment vars in Test.pm: like PARROT_ASSEMBLER or
ASSEMBLER_IS_IMCC, which immediately could run the pasm file.
- still: a preprocesoor for imcc ;-)

leo


(the original assemble.pl was renamed to oassemble.pl and get used as preprocessor only - This is almost the same as new_assemble.pl by Juergen Boemmels s. #18747)

#!/usr/bin/perl -w

use FindBin;
use strict;

my $files = [];
my $args = {};

while (my $arg = shift @ARGV) {
if($arg =~ /^-(c|-checksyntax)$/) { $args->{-c} = 1; }
elsif($arg =~ /^-E$/) { $args->{-E} = 1; }
elsif($arg =~ /^-(o|-output)$/) { $args->{-o} = shift @ARGV; }
elsif($arg =~ /^-(h|-help)$/) { Usage(); exit 0; }
elsif($arg =~ /^-./) { Fail("Invalid option '$arg'\n"); }
else { push @$files,$arg; }
}
Fail("No files to process.\n") unless(@$files);
Fail("File '$_' does not exist.\n") for grep { not (-e or /^-$/) } @$files;

my $output = '-o -';

$output = "-o $args->{-o}" if exists $args->{-o};

exec "perl oassemble.pl -E @$files | $FindBin::Bin/languages/imcc/imcc -c $output -a -"

Reply via email to