diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2024-09-14 21:27:36 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2024-09-17 20:12:58 +0200 |
commit | 31fd34766e33f8334c3fbcbfba2a0e1314b4f334 (patch) | |
tree | fe62be4dbd1bef8d77538b75b40589295a761114 /src/Parser.hs | |
parent | 1ac6198e7ceb660e1faec1f88f1a04aca6a2491e (diff) |
Type variables and simple unification
Diffstat (limited to 'src/Parser.hs')
-rw-r--r-- | src/Parser.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Parser.hs b/src/Parser.hs index 3c43a69..6d6809b 100644 --- a/src/Parser.hs +++ b/src/Parser.hs @@ -8,6 +8,7 @@ import Control.Monad import Control.Monad.State import Control.Monad.Writer +import Data.Map qualified as M import Data.Maybe import Data.Set qualified as S import Data.Text qualified as T @@ -66,8 +67,10 @@ parseTestFile path = do [ map (fmap someVarValueType) builtins ] , testContext = SomeExpr RootNetwork + , testNextTypeVar = 0 + , testTypeUnif = M.empty } - (res, _) = flip evalState initState $ runWriterT $ runParserT (parseTestModule absPath) path content + (res, _) = runWriter $ flip (flip runParserT path) content $ flip evalStateT initState $ parseTestModule absPath case res of Left err -> putStr (errorBundlePretty err) >> exitFailure |