Update of /cvsroot/monetdb/pathfinder/compiler/core
In directory sc8-pr-cvs16:/tmp/cvs-serv12638/compiler/core
Modified Files:
fs.brg
Log Message:
Implemeted "do replace x with y" as a single update command instead of as a
combination of insert (had to be done first) and delete.
This has the advantage that we can reuse the space that becomes available for
the new element.
Index: fs.brg
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/core/fs.brg,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -d -r1.56 -r1.57
--- fs.brg 3 Apr 2007 16:17:47 -0000 1.56
+++ fs.brg 27 Apr 2007 18:22:39 -0000 1.57
@@ -3724,16 +3724,13 @@
*
* 5. If <TargetExpr> is an element, text, comment, or
* processing instruction node, generate the update
- * operations
+ * operation
*
- * upd:insertAttributes ($parent, $alist)
- * upd:insertBefore ($target, $clist)
- * upd:delete ($target)
+ * upd:replaceNode ($target, $clist)
*
* 6. If <TargetExpr> is an attribute node, generate the
* operations
*
- * upd:insertAttributes ($parent, $alist)
* upd:insertIntoAsLast ($parent, $clist)
* upd:delete ($target).
*
@@ -3773,7 +3770,6 @@
PFvar_t *v4 = new_var (NULL);
PFvar_t *v5 = new_var (NULL);
PFvar_t *v6 = new_var (NULL);
- PFvar_t *v7 = new_var (NULL);
PFvar_t *repl = new_var (NULL);
PFvar_t *parent = new_var (NULL);
@@ -3788,8 +3784,8 @@
PFfun_t *insertlast
= function (PFqname (PFns_upd, "insertIntoAsLast"));
PFfun_t *delete = function (PFqname (PFns_upd, "delete"));
- PFfun_t *insertbefore
- = function (PFqname (PFns_upd, "insertBefore"));
+ PFfun_t *replaceNode
+ = function (PFqname (PFns_upd, "replaceNode"));
PFfun_t *error = function (PFqname (PFns_fn, "error"));
C(p)
@@ -3855,16 +3851,11 @@
let (
letbind (
var (v6),
- APPLY (insertbefore,
+ APPLY (replaceNode,
var (target),
var (repl))),
- let (
- letbind (
- var (v7),
- APPLY (delete,
- var (target))),
- nil ())),
- seq (var (v6), var (v7)))),
+ nil ()),
+ var (v6))),
default_ (
APPLY (
error,
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins