diff options
Diffstat (limited to 'src/Parser/Core.hs')
-rw-r--r-- | src/Parser/Core.hs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/Parser/Core.hs b/src/Parser/Core.hs index 341d9ca..2a74d3d 100644 --- a/src/Parser/Core.hs +++ b/src/Parser/Core.hs @@ -6,7 +6,6 @@ import Control.Monad.Writer import Data.Text (Text) import qualified Data.Text.Lazy as TL -import Data.Typeable import Data.Void import Text.Megaparsec hiding (State) @@ -28,15 +27,11 @@ data TestParserState = TestParserState , testContext :: SomeExpr } -someEmptyVar :: SomeExprType -> SomeVarValue -someEmptyVar (SomeExprType (Proxy :: Proxy a)) = SomeVarValue $ emptyVarValue @a - textSomeExprType :: SomeExprType -> Text textSomeExprType (SomeExprType p) = textExprType p -instance MonadEval TestParser where - lookupVar name = maybe (fail $ "variable not in scope: '" ++ unpackVarName name ++ "'") (return . someEmptyVar) =<< gets (lookup name . testVars) - rootNetwork = return emptyVarValue +lookupVarType :: VarName -> TestParser SomeExprType +lookupVarType name = maybe (fail $ "variable not in scope: '" ++ unpackVarName name ++ "'") return =<< gets (lookup name . testVars) skipLineComment :: TestParser () skipLineComment = L.skipLineComment $ TL.pack "#" |