Created
November 13, 2018 17:04
-
-
Save Verdagon/c943c8da510690fd99933f18d6e59146 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def evaluateFunction(globalCache0: GlobalCache, func: PFunction) = { | |
val localsCache0 = LocalsCache(Map()) | |
val (localsCache1, params) = | |
evaluateParameters(localsCache0, func.params) | |
val (globalCache1, localsCache2, expressions) = | |
evaluateExpressions(globalCache0, localsCache1, func.body) | |
val (globalCache2, localsCache3, destructors) = | |
evaluateDestructors(globalCache1, localsCache2) | |
val (localsCache4, ret) = | |
evaluateReturn(localsCache3) | |
(globalCache2, TFunction(params, expressions ++ destructors :+ ret)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment