aboutsummaryrefslogtreecommitdiffstats
path: root/src/resp.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resp.hpp')
-rw-r--r--src/resp.hpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/resp.hpp b/src/resp.hpp
index 94ea43a..f12c4c9 100644
--- a/src/resp.hpp
+++ b/src/resp.hpp
@@ -213,7 +213,7 @@ struct ATuple : public AST {
inline const AST* rrst() const { return _rst->_rst; }
inline const AST* frrst() const { return _rst->_rst->_fst; }
- bool empty() const { return _fst == 0 && _rst ==0; }
+ bool empty() const { return _fst == 0 && _rst == 0; }
size_t list_len() const {
size_t ret = 0;
@@ -358,6 +358,7 @@ struct List {
va_end(args);
}
void push_back(const AST* ast) {
+ assert(ast);
if (!head) {
head = new ATuple(ast, NULL, Cursor());
} else if (!tail) {
@@ -545,9 +546,11 @@ struct Subst : public list<Constraint> {
}
const AST* apply(const AST* in) const {
if (AType::is_expr(in)) {
+ if (in->as_tuple()->empty())
+ return in;
List out;
for (ATuple::const_iterator i = in->as_tuple()->begin(); i != in->as_tuple()->end(); ++i)
- out.push_back(apply((*i)));
+ out.push_back(apply(*i));
if (out.head)
out.head->loc = in->loc;
return out.head;
@@ -674,6 +677,7 @@ struct Engine {
CFunc f) = 0;
virtual void finishFn(CEnv& cenv, CVal ret, const AST* retT) = 0;
+ virtual CFunc getFn(CEnv& cenv, const std::string& name) = 0;
virtual void eraseFn(CEnv& cenv, CFunc f) = 0;
virtual CVal compileCall(CEnv& cenv, CFunc f, const ATuple* fT, CVals& args) = 0;