From b712a12978ea0c1f0f57bb72e28dc1286dc8ac69 Mon Sep 17 00:00:00 2001 From: Morgan Deters Date: Fri, 21 Feb 2014 14:45:52 -0500 Subject: [PATCH] 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. --- src/expr/node.h | 6 ++++-- 1 file 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::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::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(); -- 2.30.2