diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2024-10-03 12:28:08 -0600 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2024-10-03 12:29:12 -0600 |
commit | ae5ea355a32eff2b1b1762f4ac2389d94f388df7 (patch) | |
tree | 51f731607fb2d0b4814d07ed9b196c47e1778d32 /src/Language/Fiddle/Compiler.hs | |
parent | da5d0ed5b572b1fbff2f9b6c2016b7bd508b43e8 (diff) | |
download | fiddle-ae5ea355a32eff2b1b1762f4ac2389d94f388df7.tar.gz fiddle-ae5ea355a32eff2b1b1762f4ac2389d94f388df7.tar.bz2 fiddle-ae5ea355a32eff2b1b1762f4ac2389d94f388df7.zip |
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.
Diffstat (limited to 'src/Language/Fiddle/Compiler.hs')
-rw-r--r-- | src/Language/Fiddle/Compiler.hs | 18 |
1 files changed, 18 insertions, 0 deletions
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 -> |