Update of /cvsroot/monetdb/pathfinder/compiler/core
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv16754/compiler/core

Modified Files:
        coreopt.brg 
Log Message:
propagated changes of Sunday Feb 03 2008 - Friday Feb 08 2008
from the XQuery_0-22 branch to the development trunk


Index: coreopt.brg
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/core/coreopt.brg,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- coreopt.brg 31 Jan 2008 16:13:30 -0000      1.57
+++ coreopt.brg 8 Feb 2008 22:38:19 -0000       1.58
@@ -617,24 +617,24 @@
 
                 PFcnode_t *c = R(p);
 
-                if (LLR(p)->kind != c_nil) {
+                if (LLR(p)->kind != c_nil)
                     c = let (letbind (LLR(p), num (1)), c);
 
-                    /* fix types */
-                    TY(LR(c)) = PFty_xs_integer ();
-                    c->sem.flwr.quantifier = PFty_one;
-                }
-
                 *p = *let (letbind (LLL(p), LR(p)), c);
-                /* type let binding */
-                p->sem.flwr.quantifier = PFty_one;
 
-                relabel (p, kids);
+                /* type-check what we just created */
+                PFty_check (flwr (p, num(1)));
+
                 rewritten = true;
 
+                /*
+                 * Re-label entire subtree. Type-checking may have
+                 * modified all the state labels in the subtree, so
+                 * we have to restore them.
+                 */
+                PFcoreopt_label (p);
                 break;
             }
-
             break;
 
         /* OptBindExpr:        let (letbind (var,
@@ -662,14 +662,18 @@
             if (RLR(p)->kind == c_orderby)
                 RLR(p) = R(RLR(p));
     
-            /* type let binding */
-            p->sem.flwr.quantifier    = 
-            R(p)->sem.flwr.quantifier = RR(p)->sem.flwr.quantifier;
+            /* type-check what we just created */
+            PFty_check (flwr (p, num(1)));
 
-            relabel (p, kids);
             rewritten = true;
-            break;
 
+            /*
+             * Re-label entire subtree. Type-checking may have
+             * modified all the state labels in the subtree, so
+             * we have to restore them.
+             */
+            PFcoreopt_label (p);
+            break;
 
         /* OptBindExpr:        let (letbind (var,
                                              flwr (let (letbind (var, 
@@ -693,12 +697,17 @@
                                          LRR(p))),
                           R(p)));                        /*     ret e''      */
 
-            /* type let binding */
-            p->sem.flwr.quantifier    = 
-            R(p)->sem.flwr.quantifier = RR(p)->sem.flwr.quantifier;
+            /* type-check what we just created */
+            PFty_check (flwr (p, num (1)));
 
-            relabel (p, kids);
             rewritten = true;
+
+            /*
+             * Re-label entire subtree. Type-checking may have
+             * modified all the state labels in the subtree, so
+             * we have to restore them.
+             */
+            PFcoreopt_label (p);
             break;
 
         /* CoreExpr:           typesw (CoreExpr,


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to