Skip to content

Commit

Permalink
Finish removing "easy" cases of direct cross-module class referencing
Browse files Browse the repository at this point in the history
  • Loading branch information
sorear committed Jan 15, 2012
1 parent d6e29a5 commit f5fd473
Show file tree
Hide file tree
Showing 13 changed files with 601 additions and 426 deletions.
8 changes: 1 addition & 7 deletions Makefile
Expand Up @@ -118,14 +118,8 @@ boot/obj/Run.NieczaBackendDotnet.ser: boot/obj/Run.CompilerBlob.dll


# grep -r '^use' src/*.pm6 | sed 's|src/\(.*\)\.pm6:use \(.*\);|boot/obj/Run.\1.ser: boot/obj/Run.\2.ser|' | grep -v MONKEY_TYPING # grep -r '^use' src/*.pm6 | sed 's|src/\(.*\)\.pm6:use \(.*\);|boot/obj/Run.\1.ser: boot/obj/Run.\2.ser|' | grep -v MONKEY_TYPING
boot/obj/Run.NieczaActions.ser: boot/obj/Run.OpHelpers.ser boot/obj/Run.NieczaActions.ser: boot/obj/Run.OpHelpers.ser
boot/obj/Run.NieczaFrontendSTD.ser: boot/obj/Run.NieczaGrammar.ser
boot/obj/Run.NieczaFrontendSTD.ser: boot/obj/Run.STD.ser boot/obj/Run.NieczaFrontendSTD.ser: boot/obj/Run.STD.ser
boot/obj/Run.NieczaFrontendSTD.ser: boot/obj/Run.NieczaGrammar.ser
boot/obj/Run.NieczaGrammar.ser: boot/obj/Run.STD.ser boot/obj/Run.NieczaGrammar.ser: boot/obj/Run.STD.ser
boot/obj/Run.Operator.ser: boot/obj/Run.OpHelpers.ser boot/obj/Run.Operator.ser: boot/obj/Run.OpHelpers.ser
boot/obj/Run.Operator.ser: boot/obj/Run.Sig.ser
boot/obj/Run.Op.ser: boot/obj/Run.CgOp.ser
boot/obj/Run.OptBeta.ser: boot/obj/Run.CgOp.ser
boot/obj/Run.OptRxSimple.ser: boot/obj/Run.RxOp.ser boot/obj/Run.OptRxSimple.ser: boot/obj/Run.RxOp.ser
boot/obj/Run.RxOp.ser: boot/obj/Run.CClass.ser
boot/obj/Run.RxOp.ser: boot/obj/Run.CgOp.ser
boot/obj/Run.Sig.ser: boot/obj/Run.CgOp.ser
2 changes: 2 additions & 0 deletions src/CClass.pm6
@@ -1,3 +1,4 @@
our ($CClass);
class CClass; class CClass;


has $.terms; has $.terms;
Expand Down Expand Up @@ -90,3 +91,4 @@ our &internal = sub ($name) {
die "unknown internal cclass $name"; die "unknown internal cclass $name";
} }
method internal($name) { &internal($name) } method internal($name) { &internal($name) }
INIT { $CClass = CClass }
3 changes: 3 additions & 0 deletions src/CgOp.pm6
@@ -1,3 +1,4 @@
our ($CgOp);
class CgOp; class CgOp;


method _cgop(*@bits) { method _cgop(*@bits) {
Expand Down Expand Up @@ -115,3 +116,5 @@ method methodcall($obj, $name, *@args) {
my ($sig, $aout) = CgOp._process_arglist(@args); my ($sig, $aout) = CgOp._process_arglist(@args);
CgOp._cgop('methodcall', $name, $sig, $obj, @$aout); CgOp._cgop('methodcall', $name, $sig, $obj, @$aout);
} }

INIT { $CgOp = CgOp }
18 changes: 10 additions & 8 deletions src/NieczaActions.pm6
Expand Up @@ -23,7 +23,7 @@ our ($Operator, $Operator_Method, $Operator_Replicate, $Operator_FlipFlop,
$Operator_DotEq, $Operator_Mixin, $Operator_Let, $Operator_PostCall, $Operator_DotEq, $Operator_Mixin, $Operator_Let, $Operator_PostCall,
$Operator_Function, $Operator_CompoundAssign); $Operator_Function, $Operator_CompoundAssign);


our ($CgOp, $CClass, $Sig, $SigParameter); our ($CgOp, $CClass, $Sig, $SigParameter, $OptRxSimple, $OptBeta, $Actions);


class NieczaActions; class NieczaActions;


Expand Down Expand Up @@ -459,8 +459,8 @@ method rxembed($/, $op, $) {
method op_for_regex($/, $rxop) { method op_for_regex($/, $rxop) {
my @lift = $rxop.oplift; my @lift = $rxop.oplift;
my $ltm = ::GLOBAL::OptRxSimple.run_lad($rxop.lad); my $ltm = $OptRxSimple.run_lad($rxop.lad);
my ($orxop, $mb) = ::GLOBAL::OptRxSimple.run($rxop); my ($orxop, $mb) = $OptRxSimple.run($rxop);
my $sub = self.thunk_sub($OpRegexBody.new(pos=>$/, my $sub = self.thunk_sub($OpRegexBody.new(pos=>$/,
canback => $mb, pre => @lift, rxop => $orxop), canback => $mb, pre => @lift, rxop => $orxop),
class => 'Regex', params => ['self'], :$ltm); class => 'Regex', params => ['self'], :$ltm);
Expand All @@ -484,7 +484,7 @@ method quote:m ($/) {
method encapsulate_regex($/, $rxop, :$passcut = False) { method encapsulate_regex($/, $rxop, :$passcut = False) {
my @lift = $rxop.oplift; my @lift = $rxop.oplift;
my $lad = $rxop.lad; my $lad = $rxop.lad;
my ($nrxop, $mb) = ::GLOBAL::OptRxSimple.run($rxop); my ($nrxop, $mb) = $OptRxSimple.run($rxop);
my $subop = self.thunk_sub( my $subop = self.thunk_sub(
$OpRegexBody.new(canback => $mb, pre => @lift, :$passcut, $OpRegexBody.new(canback => $mb, pre => @lift, :$passcut,
rxop => $nrxop), ltm => $lad, class => 'Regex', params => ['self']); rxop => $nrxop), ltm => $lad, class => 'Regex', params => ['self']);
Expand Down Expand Up @@ -545,9 +545,9 @@ method regex_def($/) {
} }
my @lift = $ast.oplift; my @lift = $ast.oplift;
my $ltm = ::GLOBAL::OptRxSimple.run_lad($ast.lad); my $ltm = $OptRxSimple.run_lad($ast.lad);
$*CURLEX<!sub>.set_ltm($ltm); $*CURLEX<!sub>.set_ltm($ltm);
($ast, my $mb) = ::GLOBAL::OptRxSimple.run($ast); ($ast, my $mb) = $OptRxSimple.run($ast);
if $<regex_block><onlystar> { if $<regex_block><onlystar> {
$*CURLEX<!sub>.finish_dispatcher('regex'); $*CURLEX<!sub>.finish_dispatcher('regex');
} else { } else {
Expand Down Expand Up @@ -1410,7 +1410,7 @@ method circumfix:sym<{ }> ($/) {
if self.check_hash($/) { if self.check_hash($/) {
make mkcall($/, '&_hash_constructor', make mkcall($/, '&_hash_constructor',
::GLOBAL::OptBeta.make_call($var)); $OptBeta.make_call($var));
} }
} }
Expand Down Expand Up @@ -3627,7 +3627,7 @@ method block_expr($/, $pb) {
method inliney_call($/, $block, *@parms) { method inliney_call($/, $block, *@parms) {
my $sym = self.gensym; my $sym = self.gensym;
$*CURLEX<!sub>.add_my_sub($sym, $block); $*CURLEX<!sub>.add_my_sub($sym, $block);
::GLOBAL::OptBeta.make_call($sym, @parms); $OptBeta.make_call($sym, @parms);
} }
# this is intended to be called after parsing the longname for a sub, # this is intended to be called after parsing the longname for a sub,
Expand Down Expand Up @@ -3981,3 +3981,5 @@ method comp_unit($/) {
make $*unit; make $*unit;
} }
INIT { $Actions = NieczaActions }
3 changes: 3 additions & 0 deletions src/NieczaPassSimplifier.pm6
@@ -1,5 +1,6 @@
our ($OpSimplePair, $OpCallSub, $OpLexical, $OpBuiltin, $OpTake, our ($OpSimplePair, $OpCallSub, $OpLexical, $OpBuiltin, $OpTake,
$OpControl, $OpMakeJunction, $OpGeneralConst); $OpControl, $OpMakeJunction, $OpGeneralConst);
our ($PassSimplifier);


class NieczaPassSimplifier; class NieczaPassSimplifier;


Expand Down Expand Up @@ -176,3 +177,5 @@ sub run_optree($body, $op, $nv) {


$func($body, $nv, $invname, $op); $func($body, $nv, $invname, $op);
} }

INIT { $PassSimplifier = NieczaPassSimplifier; }

0 comments on commit f5fd473

Please sign in to comment.