diff options
author | David Robillard <d@drobilla.net> | 2010-12-02 08:03:47 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-12-02 08:03:47 +0000 |
commit | cf6c924f9cb10a583edbab2560773f2500a86323 (patch) | |
tree | 9073dbe14d904764d4af59141a03228f2e0fbf8e /src/repl.cpp | |
parent | 563a807be78bfe12e5bfbb9ff0d6da44242696c4 (diff) | |
download | resp-cf6c924f9cb10a583edbab2560773f2500a86323.tar.gz resp-cf6c924f9cb10a583edbab2560773f2500a86323.tar.bz2 resp-cf6c924f9cb10a583edbab2560773f2500a86323.zip |
Work towards removing different classes for each type of expression.
git-svn-id: http://svn.drobilla.net/resp/resp@278 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'src/repl.cpp')
-rw-r--r-- | src/repl.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/repl.cpp b/src/repl.cpp index d0a251b..923c26d 100644 --- a/src/repl.cpp +++ b/src/repl.cpp @@ -100,7 +100,7 @@ eval(CEnv& cenv, Cursor& cursor, istream& is, bool execute) // Lift all expressions Code lifted; for (list<AST*>::iterator i = parsed.begin(); i != parsed.end(); ++i) { - AST* l = (*i)->lift(cenv, lifted); + AST* l = resp_lift(cenv, lifted, *i); if (l) lifted.push_back(l); } @@ -116,7 +116,7 @@ eval(CEnv& cenv, Cursor& cursor, istream& is, bool execute) for (Code::const_iterator i = lifted.begin(); i != lifted.end(); ++i) { const ADef* def = (*i)->to<const ADef*>(); if (def && def->list_ref(2)->to<const AFn*>()) { - val = def->compile(cenv); + val = resp_compile(cenv, def); } else { assert(*i); ATuple* tup = (*i)->to<ATuple*>(); @@ -133,7 +133,7 @@ eval(CEnv& cenv, Cursor& cursor, istream& is, bool execute) // Compile expressions (other than function definitions) into it for (list<AST*>::const_iterator i = exprs.begin(); i != exprs.end(); ++i) - val = (*i)->compile(cenv); + val = resp_compile(cenv, *i); // Finish compilation cenv.engine()->finishFunction(cenv, f, val); @@ -170,14 +170,14 @@ repl(CEnv& cenv) break; Code lifted; - ast = ast->lift(cenv, lifted); + ast = resp_lift(cenv, lifted, ast); const AType* type = cenv.type(ast); const AType* fnT = tup<const AType>(cursor, cenv.tenv.Fn, new AType(cursor), type, 0); CFunc f = NULL; try { // Create function for this repl loop f = cenv.engine()->startFunction(cenv, replFnName, new ATuple(cursor), fnT); - cenv.engine()->finishFunction(cenv, f, ast->compile(cenv)); + cenv.engine()->finishFunction(cenv, f, resp_compile(cenv, ast)); callPrintCollect(cenv, f, ast, type, true); if (cenv.args.find("-d") != cenv.args.end()) cenv.engine()->writeModule(cenv, cenv.out); |