From 31fd34766e33f8334c3fbcbfba2a0e1314b4f334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sat, 14 Sep 2024 21:27:36 +0200 Subject: Type variables and simple unification --- src/Parser.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Parser.hs') 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 -- cgit v1.2.3