summaryrefslogtreecommitdiff
path: root/colm/tree.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'colm/tree.cpp')
-rw-r--r--colm/tree.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/colm/tree.cpp b/colm/tree.cpp
index 42bcec9b..434a34f6 100644
--- a/colm/tree.cpp
+++ b/colm/tree.cpp
@@ -259,6 +259,19 @@ Tree *construct_replacement_tree( Tree **bindings, Program *prg, long pat )
tree->child = kid_list_concat( attrs,
kid_list_concat( ignore, child ) );
+
+ for ( int i = 0; i < lelInfo[tree->id].numCaptureAttr; i++ ) {
+ long ci = pat+1+i;
+ CaptureAttr *ca = prg->rtd->captureAttr + lelInfo[tree->id].captureAttr + i;
+ Tree *attr = prg->treePool.allocate();
+ attr->id = nodes[ci].id;
+ attr->refs = 1;
+ attr->tokdata = nodes[ci].length == 0 ? 0 :
+ string_alloc_const( prg,
+ nodes[ci].data, nodes[ci].length );
+
+ set_attr( tree, ca->offset, attr );
+ }
}
return tree;