Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

resolve conflict in opsc

  • Loading branch information...
commit 2eb2f979b2ec8c7ebe0dd2609bf22753c6950447 1 parent 95b0fa1
@luben luben authored
View
1  MANIFEST
@@ -80,7 +80,6 @@ compilers/opsc/src/Ops/Op.pm [opsc]
compilers/opsc/src/Ops/OpLib.pm [opsc]
compilers/opsc/src/Ops/Trans.pm [opsc]
compilers/opsc/src/Ops/Trans/C.pm [opsc]
-compilers/opsc/src/Ops/Util.pm [opsc]
compilers/opsc/src/builtins.pir [opsc]
compilers/pct/Defines.mak [pct]
compilers/pct/PCT.pir [pct]
View
54 compilers/opsc/ops2c.nqp
@@ -58,54 +58,17 @@ sub MAIN() {
)
!! undef;
- my $f;
- my $do_dump_file := 0;
- my $do_load := 1;
- my $dump_file := $core ?? 'src/ops/ops.dump' !! @files[0] ~ ".dump";
- if $opts<dump> {
- try {
- my $fh := open($dump_file, :r, :bin);
- my $dump := $fh.readall;
- $fh.close();
-
- $f := pir::thaw__ps($dump);
- $do_load := 0;
-
- CATCH {
- $quiet || pir::say("# Caught $!");
- $do_dump_file := 1;
- $f := undef;
- };
- }
- }
-
- if $do_load {
- $f := Ops::File.new(|@files,
- :oplib($lib),
- :core($core),
- :quiet($quiet),
- );
- }
-
- if $do_dump_file {
- $quiet || say("Dumping");
- my $capture := Ops::Util::strip_source($f);
- my $frozen := pir::freeze__sp($capture);
-
- my $fh := open($dump_file, :w, :bin);
- $fh.print($frozen);
- $fh.close();
- }
+ my $f := Ops::File.new(|@files, :oplib($lib), :core($core), :quiet($quiet));
$quiet || say("# Ops parsed in { pir::sprintf__ssp("%.3f", [pir::time__N() - $start_time] ) } seconds.");
+
+ my $emitter := Ops::Emitter.new(
+ :ops_file($f), :trans($trans),
+ :script('ops2c.nqp'), :file(@files[0]),
+ :flags( hash( core => $core, quiet => $quiet ) ),
+ );
unless $debug {
- my $emitter := Ops::Emitter.new(
- :ops_file($f), :trans($trans),
- :script('ops2c.nqp'), :file(@files[0]),
- :flags( hash( core => $core, quiet => $quiet ) ),
- );
-
$emitter.print_ops_num_files() if $core;
$emitter.print_c_header_files();
$emitter.print_c_source_file();
@@ -135,9 +98,6 @@ sub get_options() {
# suppress timing and debug output on stdout
$getopts.add_option('quiet', 'q');
- # Use .dump files with parsed ops.
- $getopts.add_option('dump', 'D');
-
$getopts.get_options(pir::getinterp__p()[2]);
}
View
10 compilers/opsc/src/Ops/Compiler/Actions.pm
@@ -104,7 +104,7 @@ method op ($/, $key?) {
my @variants := expand_args(pir::clone__PP($OP<normalized_args>));
if @variants {
for @variants {
- my $new_op := deep_clone($OP);
+ my $new_op := pir::clone__PP($OP);
$new_op<arg_types> := $_;
$past.push($new_op);
}
@@ -117,12 +117,6 @@ method op ($/, $key?) {
}
}
-sub deep_clone($thingy) {
- Ops::Util::process_recursive($thingy, -> $_ {
- $_.WHAT.new;
- });
-}
-
# Normalize args
# For each arg produce LoL of all available variants
# E.g. "in" will produce "i" and "ic" variants
@@ -173,8 +167,6 @@ sub normalize_args(@args) {
$res<direction> := 'o';
}
- #$arg<type> := $res<type>;
-
@result.push($res);
}
@result;
View
4 compilers/opsc/src/Ops/File.pm
@@ -181,7 +181,7 @@ ops file.
=end
-method new(*@files, :$oplib, :$core, :$nolines, :$quiet? = 0) {
+method new(*@files, :$oplib, :$core!, :$nolines, :$quiet? = 0) {
self<files> := @files;
self<core> := $core;
self<ops> := list(); # Ops
@@ -258,7 +258,7 @@ method compile_ops($str, :$experimental? = 0) {
my $past := $compiler.compile($str, :target('past'));
for @($past<ops>) {
- $_<experimental> := ?$experimental;
+ $_<experimental> := $experimental;
self<ops>.push($_);
#say($_.full_name ~ " is number " ~ self<op_order>);
self<op_order>++;
Please sign in to comment.
Something went wrong with that request. Please try again.