mirror of
https://github.com/anoma/juvix.git
synced 2025-01-08 16:51:53 +03:00
5de0026d83
Co-authored-by: Paul Cadman <git@paulcadman.dev>
18 lines
592 B
Haskell
18 lines
592 B
Haskell
module BackendGeb.Compilation.Base where
|
|
|
|
import BackendGeb.FromCore.Base
|
|
import Base
|
|
import Juvix.Compiler.Backend (Target (TargetGeb))
|
|
import Juvix.Compiler.Core qualified as Core
|
|
|
|
gebCompilationAssertion ::
|
|
Path Abs File ->
|
|
Path Abs File ->
|
|
(String -> IO ()) ->
|
|
Assertion
|
|
gebCompilationAssertion mainFile expectedFile step = do
|
|
step "Translate to JuvixCore"
|
|
entryPoint <- set entryPointTarget TargetGeb <$> defaultEntryPointCwdIO mainFile
|
|
tab <- (^. Core.coreResultTable) . snd <$> runIO' entryPoint upToCore
|
|
coreToGebTranslationAssertion' tab entryPoint expectedFile step
|