core driver

This commit is contained in:
crumbtoo
2024-02-01 15:24:16 -07:00
parent ff5a5af9bc
commit 77f2f900d8
6 changed files with 42 additions and 19 deletions

View File

@@ -3,12 +3,15 @@ module CoreDriver
)
where
--------------------------------------------------------------------------------
import Compiler.RLPC
import Control.Monad
import Core.Lex
import Core.Parse
import GM
--------------------------------------------------------------------------------
driver :: RLPCIO ()
driver = undefined
parseProg :: RLPCOptions
-> Text
-> (Maybe Program', [MsgEnvelope RlpcError])
parseProg o = lexCoreR >=> parseCoreProgR
driver = forFiles_ $ \f ->
withSource f (lexCoreR >=> parseCoreProgR >=> evalProgR)

View File

@@ -107,11 +107,3 @@ driver = view rlpcLanguage >>= \case
LanguageCore -> CoreDriver.driver
LanguageRlp -> RlpDriver.driver
forFiles_ :: (Monad m)
=> (RLPCOptions -> FilePath -> RLPCT m a)
-> RLPCT m ()
forFiles_ k = do
fs <- view rlpcInputFiles
o <- ask
forM_ fs (k o)

View File

@@ -0,0 +1,11 @@
module RlpDriver
( driver
)
where
--------------------------------------------------------------------------------
import Compiler.RLPC
--------------------------------------------------------------------------------
driver :: RLPCIO ()
driver = undefined