diff options
Diffstat (limited to 'src/repl.cpp')
-rw-r--r-- | src/repl.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/repl.cpp b/src/repl.cpp index 334cea3..02a2a8e 100644 --- a/src/repl.cpp +++ b/src/repl.cpp @@ -68,14 +68,15 @@ readParseType(CEnv& cenv, Cursor& cursor, istream& is, const AST*& exp, const AS } static void -callPrintCollect(CEnv& cenv, CFunc f, const AST* result, const AType* resultT, bool execute) +callPrintCollect(CEnv& cenv, CFunc f, const AST* result, const AST* resultT, bool execute) { if (execute) cenv.out << cenv.engine()->call(cenv, f, resultT); // Print type (if applicable) - if (resultT->head()->str() != "Nothing") - cenv.out << " : " << resultT << endl; + const std::string type_str = resultT->str(); + if (type_str != "Nothing") + cenv.out << " : " << type_str << endl; Object::pool.collect(Object::pool.roots()); } @@ -145,8 +146,8 @@ eval(CEnv& cenv, Cursor& cursor, istream& is, bool execute) } } - const AType* type = cenv.type(exprs.back()); - const AType* fnT = tup<const AType>(cursor, cenv.tenv.Fn, new AType(cursor), type, 0); + const AST* type = cenv.type(exprs.back()); + const ATuple* fnT = tup(cursor, cenv.tenv.Fn, new ATuple(cursor), type, 0); // Create function for top-level of program f = cenv.engine()->startFn(cenv, "main", new ATuple(cursor), fnT); @@ -193,8 +194,8 @@ repl(CEnv& cenv) Code 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); + const AST* type = cenv.type(ast); + const ATuple* fnT = tup(cursor, cenv.tenv.Fn, new ATuple(cursor), type, 0); CFunc f = NULL; try { // Create function for this repl loop |