diff options
Diffstat (limited to 'src/repl.cpp')
-rw-r--r-- | src/repl.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/repl.cpp b/src/repl.cpp index 1ec1834..bca6037 100644 --- a/src/repl.cpp +++ b/src/repl.cpp @@ -32,12 +32,12 @@ eval(CEnv& cenv, const string& name, istream& is) { AST* result = NULL; AType* resultType = NULL; - list< pair<SExp, AST*> > exprs; + list< pair<AST*, AST*> > exprs; Cursor cursor(name); try { while (true) { - SExp exp = readExpression(cursor, is); - if (exp.type == SExp::LIST && exp.empty()) + AST* exp = readExpression(cursor, is); + if (exp->to<ATuple*>() && exp->to<ATuple*>()->empty()) break; result = cenv.penv.parse(exp); // Parse input @@ -71,7 +71,7 @@ eval(CEnv& cenv, const string& name, istream& is) CFunction f = cenv.engine()->startFunction(cenv, "main", resultType, ATuple(cursor)); // Compile all expressions into it - for (list< pair<SExp, AST*> >::const_iterator i = exprs.begin(); i != exprs.end(); ++i) + for (list< pair<AST*, AST*> >::const_iterator i = exprs.begin(); i != exprs.end(); ++i) val = cenv.compile(i->second); // Finish and call it @@ -102,8 +102,8 @@ repl(CEnv& cenv) Cursor cursor("(stdin)"); try { - SExp exp = readExpression(cursor, std::cin); - if (exp.type == SExp::LIST && exp.empty()) + AST* exp = readExpression(cursor, std::cin); + if (exp->to<ATuple*>() && exp->to<ATuple*>()->empty()) break; AST* body = cenv.penv.parse(exp); // Parse input |