Skip to content

Commit

Permalink
fix the tests not compiling (oops)
Browse files Browse the repository at this point in the history
  • Loading branch information
bristermitten committed Oct 3, 2023
1 parent 4a620ee commit 4ff8661
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Elara/Shunt.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

module Elara.Shunt where

import Control.Lens (over, to, traverseOf, view, (^.), _1)
import Control.Lens (over, to, traverseOf, (^.), _1)
import Data.Generics.Product (HasField' (field'))
import Data.Generics.Wrapped
import Data.Map (lookup)
Expand Down
6 changes: 4 additions & 2 deletions test/Infer/Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Elara.Lexer.Pipeline (runLexPipeline)
import Elara.Lexer.Reader (readTokensWith)
import Elara.Parse (parsePipeline, runParsePipeline)
import Elara.Parse.Expression (exprParser)
import Elara.Pipeline (finalisePipeline)
import Elara.Pipeline (PipelineRes, finalisePipeline)
import Elara.Prim.Rename (primitiveRenameState)
import Elara.Rename (renameExpr, runRenamePipeline)
import Elara.Shunt (runShuntPipeline, shuntExpr)
Expand All @@ -27,6 +27,7 @@ import Elara.TypeInfer.Type qualified as Type
import Elara.TypeInfer.Unique
import Polysemy
import Polysemy.Error (Error, errorToIOFinal)
import Polysemy.Reader (runReader)
import Polysemy.State (State)
import Print (showPretty)
import Test.HUnit (assertFailure)
Expand All @@ -48,12 +49,13 @@ completeInference x = do
ctx <- Infer.getAll
completeExpression ctx x

inferFully :: (ToString a) => a -> PipelineRes TypedExpr
inferFully source = finalisePipeline . runInferPipeline . runShuntPipeline mempty . runParsePipeline . runLexPipeline $ do
let fp = "<tests>"
tokens <- readTokensWith fp (toString source)
parsed <- parsePipeline exprParser fp tokens
desugared <- runDesugarPipeline $ runDesugar $ desugarExpr parsed
renamed <- runRenamePipeline (createGraph []) primitiveRenameState (renameExpr desugared)
renamed <- runRenamePipeline (createGraph []) primitiveRenameState (runReader Nothing $ renameExpr desugared)
shunted <- shuntExpr renamed
inferExpression shunted Nothing >>= completeInference

Expand Down

0 comments on commit 4ff8661

Please sign in to comment.