1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 14:21:31 +03:00

Use AbstractFunction to evaluate Declaration.Function.

This commit is contained in:
Rob Rix 2018-02-27 16:51:44 -05:00
parent 8003abbcd9
commit 7a8466c695

View File

@ -48,9 +48,7 @@ instance ( Semigroup (Cell l (Value l t))
eval Function{..} = do eval Function{..} = do
env <- ask env <- ask
let params = toList (liftFreeVariables (freeVariables . subterm) functionParameters) let params = toList (liftFreeVariables (freeVariables . subterm) functionParameters)
-- FIXME: Can we store the action evaluating the body in the Value instead of the body term itself? v <- abstract params functionBody
let v = inj (Closure params (subterm functionBody) env) :: Value l t
(name, addr) <- lookupOrAlloc (subterm functionName) v env (name, addr) <- lookupOrAlloc (subterm functionName) v env
modify (envInsert name addr) modify (envInsert name addr)
pure v pure v