From ae5ea355a32eff2b1b1762f4ac2389d94f388df7 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Thu, 3 Oct 2024 12:28:08 -0600 Subject: Add empty qualification stage. This stage will be responsible for qualifying all types and attaching necessary metadata to make the job of later stages much easier. --- src/Language/Fiddle/Compiler.hs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/Language/Fiddle/Compiler.hs') diff --git a/src/Language/Fiddle/Compiler.hs b/src/Language/Fiddle/Compiler.hs index 24c7da0..a7b07ea 100644 --- a/src/Language/Fiddle/Compiler.hs +++ b/src/Language/Fiddle/Compiler.hs @@ -101,6 +101,24 @@ fromMayberOrFail sourceSpan err Nothing = do compilationFailure fromMayberOrFail _ _ (Just a) = return a +pureCompilationPhase :: + (CompilationStage stageFrom) => + ( FiddleUnit + stageFrom + (StageFunctor stageFrom) + (StageAnnotation stageFrom) -> + Compile + () + ( FiddleUnit + stageTo + (StageFunctor stageTo) + (StageAnnotation stageTo) + ) + ) -> + CompilationPhase stageFrom stageTo +pureCompilationPhase fn = + CompilationPhase (pure ()) (\_ _ -> return ([], Just ())) (\_ _ -> fn) + -- data IOActionExtraData = IOActionExtraData -- { parseFile :: FilePath -> IO (TreeType FiddleUnit Parsed), -- stage3Compile :: TreeType FiddleUnit Parsed -> -- cgit