diff options
Diffstat (limited to 'src/repl.cpp')
-rw-r--r-- | src/repl.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/repl.cpp b/src/repl.cpp index df85293..1ec1834 100644 --- a/src/repl.cpp +++ b/src/repl.cpp @@ -26,6 +26,7 @@ using namespace std; +/// Compile and evaluate code from @a is int eval(CEnv& cenv, const string& name, istream& is) { @@ -42,7 +43,7 @@ eval(CEnv& cenv, const string& name, istream& is) result = cenv.penv.parse(exp); // Parse input Constraints c; result->constrain(cenv.tenv, c); // Constrain types - cenv.tsubst = Subst::compose(cenv.tsubst, TEnv::unify(c)); // Solve type constraints + cenv.tsubst = Subst::compose(cenv.tsubst, unify(c)); // Solve type constraints resultType = cenv.type(result); result->lift(cenv); // Lift functions exprs.push_back(make_pair(exp, result)); @@ -91,6 +92,7 @@ eval(CEnv& cenv, const string& name, istream& is) return 0; } +/// Read Eval Print Loop int repl(CEnv& cenv) { @@ -109,7 +111,7 @@ repl(CEnv& cenv) body->constrain(cenv.tenv, c); // Constrain types Subst oldSubst = cenv.tsubst; - cenv.tsubst = Subst::compose(cenv.tsubst, TEnv::unify(c)); // Solve type constraints + cenv.tsubst = Subst::compose(cenv.tsubst, unify(c)); // Solve type constraints AType* bodyT = cenv.type(body); THROW_IF(!bodyT, cursor, "call to untyped body") |