summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@cs.nyu.edu>2014-02-21 14:45:52 -0500
committerMorgan Deters <mdeters@cs.nyu.edu>2014-02-21 15:06:14 -0500
commitb712a12978ea0c1f0f57bb72e28dc1286dc8ac69 (patch)
tree1ffd38eebe3fdd1259857b55d8badf7044afa588 /src
parentcca221de7d29e86fd770af3aca0efc0d877dff26 (diff)
Fix two variants of Node::substitute().
Node::substitute() is overloaded. One version was properly substituting operators (e.g. the "f" in f(x) could be substituted). The others were ignoring anything in function position. Fixed. Thanks to Wei Wang for pointing this out.
Diffstat (limited to 'src')
-rw-r--r--src/expr/node.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/expr/node.h b/src/expr/node.h
index e7c51f0e2..9ada7879c 100644
--- a/src/expr/node.h
+++ b/src/expr/node.h
@@ -1376,7 +1376,9 @@ NodeTemplate<ref_count>::substitute(Iterator1 nodesBegin,
NodeBuilder<> nb(getKind());
if(getMetaKind() == kind::metakind::PARAMETERIZED) {
// push the operator
- nb << getOperator();
+ nb << getOperator().substitute(nodesBegin, nodesEnd,
+ replacementsBegin, replacementsEnd,
+ cache);
}
for(const_iterator i = begin(),
iend = end();
@@ -1427,7 +1429,7 @@ NodeTemplate<ref_count>::substitute(Iterator substitutionsBegin,
NodeBuilder<> nb(getKind());
if(getMetaKind() == kind::metakind::PARAMETERIZED) {
// push the operator
- nb << getOperator();
+ nb << getOperator().substitute(substitutionsBegin, substitutionsEnd, cache);
}
for(const_iterator i = begin(),
iend = end();
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback