tricu/src/FileEval.hs

20 lines
442 B
Haskell
Raw Normal View History

module FileEval where
import Eval
import Library
import Parser
import Research
import System.IO
import qualified Data.Map as Map
evaluateFile :: FilePath -> IO T
evaluateFile filePath = do
contents <- readFile filePath
let asts = parseTricu contents
let finalEnv = evalTricu library asts
case Map.lookup "__result" finalEnv of
Just finalResult -> return finalResult
Nothing -> error "No result found in final environment"