summaryrefslogtreecommitdiff
path: root/DSL.hs
blob: 50d8ca3b3b3db2b60efdbda6336b049b7fd00103 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module DSL where

import DSL.Types
import DSL.Util
import DSL.Parsing
import DSL.Interpretation

interpretFromString :: String -> IO ()
interpretFromString = maybe err interpret . stringToProgram
  where
    err = putStrLn "Unable to parse program"

interpretFromFile :: FilePath -> IO ()
interpretFromFile path = readFile path >>= interpretFromString