2024-12-29 21:49:57 -06:00
|
|
|
module Compiler where
|
|
|
|
|
|
|
|
import Eval
|
2024-12-30 14:19:43 -06:00
|
|
|
import Library
|
2024-12-29 21:49:57 -06:00
|
|
|
import Parser
|
|
|
|
import Research
|
|
|
|
|
|
|
|
import System.IO
|
|
|
|
|
|
|
|
import qualified Data.Map as Map
|
|
|
|
|
|
|
|
evaluateFile :: FilePath -> IO T
|
|
|
|
evaluateFile filePath = do
|
|
|
|
contents <- readFile filePath
|
2024-12-30 14:19:43 -06:00
|
|
|
let asts = parseTricu contents
|
|
|
|
let finalEnv = evalTricu library asts
|
|
|
|
case Map.lookup "__result" finalEnv of
|
2024-12-29 21:49:57 -06:00
|
|
|
Just finalResult -> return finalResult
|
|
|
|
Nothing -> error "No result found in final environment"
|