Exemple #1
0
        public static void Test3_preCH_delta()
        {
            // basic
            var C1 = new TypedSingleCH <sC1>();
            var C2 = new TypedSingleCH <sC2>();
            var C3 = new TypedSingleCH <sC3>();

            var clSC = new CH_closedScope()
                       .decl("c1", C1)
                       .decl("c2", C2)
                       .decl("c3", C3);

            var D1 = new TypedSingleCH <sD1>();
            var D2 = new TypedSingleCH <sD2>();
            var D3 = new TypedSingleCH <sD3>();

            var pD1 = new adapter_preCH(D1);
            var pD2 = new adapter_preCH(D2);
            var pD3 = new adapter_preCH(D3);

            var pdeltaSC = new preCH_deltaScope(clSC)
                           .decl("c1", pD1)
                           .decl("delta_2", pD2);

            AssertEquivalent(pdeltaSC.instantiate().close(),
                             new []        { "delta_2", "c1", "c3", "c2" },
                             new TypedCH[] { D2, D1, C3, C2 });

            // todo : MOAR!
            Console.WriteLine("================= preDeltaScoping ok ============= ");
        }
 public override preCH_deltaScope scope(preCH_deltaScope c)
 {
     foreach (var sTU in subTUs)
     {
         c = sTU.scope(c);
     }
     return(c);
 }
Exemple #3
0
        public static void Equivalent(CH_closedScope cls, preCH_deltaScope deltaSC)
        {
            int common_count = cls.refs().Count();
            var test         = cls.refs().Zip(deltaSC.refs(), (ref_L, ref_R) => ReferenceEquals(ref_L.CH, ref_R.pre_ch.CH));

            D.Assert(test.All(_ => _));                // all true
            D.Assert(test.Count() == common_count);    // re-evals ... stress testing is never bad
        }
 public override preCH_deltaScope scope(preCH_deltaScope c)
 {
     // piggyback the scoping on nonRX variant?
     if (assignVTNode != null)
     {
         return(assignVTNode.scope(c));
     }
     return(c);
 }
 public override preCH_deltaScope    scope(preCH_deltaScope c) => c;      // no decls or refs possible
Exemple #6
0
 public abstract preCH_deltaScope scope(preCH_deltaScope c);