mirror of
https://github.com/github/semantic.git
synced 2024-12-22 22:31:36 +03:00
Use AbstractFunction to evaluate Declaration.Function.
This commit is contained in:
parent
8003abbcd9
commit
7a8466c695
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user