Permalink
Browse files

Finish removing "easy" cases of direct cross-module class referencing

  • Loading branch information...
sorear committed Jan 15, 2012
1 parent d6e29a5 commit f5fd473f34b5967c160671e2b5f3f90a95d73c2e
Showing with 601 additions and 426 deletions.
  1. +1 −7 Makefile
  2. +2 −0 src/CClass.pm6
  3. +3 −0 src/CgOp.pm6
  4. +10 −8 src/NieczaActions.pm6
  5. +3 −0 src/NieczaPassSimplifier.pm6
  6. +310 −234 src/Op.pm6
  7. +20 −17 src/OpHelpers.pm6
  8. +66 −35 src/Operator.pm6
  9. +7 −5 src/OptBeta.pm6
  10. +3 −1 src/OptRxSimple.pm6
  11. +168 −117 src/RxOp.pm6
  12. +6 −2 src/Sig.pm6
  13. +2 −0 src/niecza
View
@@ -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
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.NieczaGrammar.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.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.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
View
@@ -1,3 +1,4 @@
+our ($CClass);
class CClass;
has $.terms;
@@ -90,3 +91,4 @@ our &internal = sub ($name) {
die "unknown internal cclass $name";
}
method internal($name) { &internal($name) }
+INIT { $CClass = CClass }
View
@@ -1,3 +1,4 @@
+our ($CgOp);
class CgOp;
method _cgop(*@bits) {
@@ -115,3 +116,5 @@ method methodcall($obj, $name, *@args) {
my ($sig, $aout) = CgOp._process_arglist(@args);
CgOp._cgop('methodcall', $name, $sig, $obj, @$aout);
}
+
+INIT { $CgOp = CgOp }
View
@@ -23,7 +23,7 @@ our ($Operator, $Operator_Method, $Operator_Replicate, $Operator_FlipFlop,
$Operator_DotEq, $Operator_Mixin, $Operator_Let, $Operator_PostCall,
$Operator_Function, $Operator_CompoundAssign);
-our ($CgOp, $CClass, $Sig, $SigParameter);
+our ($CgOp, $CClass, $Sig, $SigParameter, $OptRxSimple, $OptBeta, $Actions);
class NieczaActions;
@@ -459,8 +459,8 @@ method rxembed($/, $op, $) {
method op_for_regex($/, $rxop) {
my @lift = $rxop.oplift;
- my $ltm = ::GLOBAL::OptRxSimple.run_lad($rxop.lad);
- my ($orxop, $mb) = ::GLOBAL::OptRxSimple.run($rxop);
+ my $ltm = $OptRxSimple.run_lad($rxop.lad);
+ my ($orxop, $mb) = $OptRxSimple.run($rxop);
my $sub = self.thunk_sub($OpRegexBody.new(pos=>$/,
canback => $mb, pre => @lift, rxop => $orxop),
class => 'Regex', params => ['self'], :$ltm);
@@ -484,7 +484,7 @@ method quote:m ($/) {
method encapsulate_regex($/, $rxop, :$passcut = False) {
my @lift = $rxop.oplift;
my $lad = $rxop.lad;
- my ($nrxop, $mb) = ::GLOBAL::OptRxSimple.run($rxop);
+ my ($nrxop, $mb) = $OptRxSimple.run($rxop);
my $subop = self.thunk_sub(
$OpRegexBody.new(canback => $mb, pre => @lift, :$passcut,
rxop => $nrxop), ltm => $lad, class => 'Regex', params => ['self']);
@@ -545,9 +545,9 @@ method regex_def($/) {
}
my @lift = $ast.oplift;
- my $ltm = ::GLOBAL::OptRxSimple.run_lad($ast.lad);
+ my $ltm = $OptRxSimple.run_lad($ast.lad);
$*CURLEX<!sub>.set_ltm($ltm);
- ($ast, my $mb) = ::GLOBAL::OptRxSimple.run($ast);
+ ($ast, my $mb) = $OptRxSimple.run($ast);
if $<regex_block><onlystar> {
$*CURLEX<!sub>.finish_dispatcher('regex');
} else {
@@ -1410,7 +1410,7 @@ method circumfix:sym<{ }> ($/) {
if self.check_hash($/) {
make mkcall($/, '&_hash_constructor',
- ::GLOBAL::OptBeta.make_call($var));
+ $OptBeta.make_call($var));
}
}
@@ -3627,7 +3627,7 @@ method block_expr($/, $pb) {
method inliney_call($/, $block, *@parms) {
my $sym = self.gensym;
$*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,
@@ -3981,3 +3981,5 @@ method comp_unit($/) {
make $*unit;
}
+
+INIT { $Actions = NieczaActions }
@@ -1,5 +1,6 @@
our ($OpSimplePair, $OpCallSub, $OpLexical, $OpBuiltin, $OpTake,
$OpControl, $OpMakeJunction, $OpGeneralConst);
+our ($PassSimplifier);
class NieczaPassSimplifier;
@@ -176,3 +177,5 @@ sub run_optree($body, $op, $nv) {
$func($body, $nv, $invname, $op);
}
+
+INIT { $PassSimplifier = NieczaPassSimplifier; }
Oops, something went wrong.

0 comments on commit f5fd473

Please sign in to comment.