diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2024-10-10 16:38:51 -0600 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2024-10-10 16:38:51 -0600 |
commit | c2f195a23bdb0d0dc876cc548d4c3157534082c6 (patch) | |
tree | 658954b31fd7ae55ec87b4304adf024a89c3949d /src/Language/Fiddle/Ast/Internal/SyntaxTree.hs | |
parent | 069268394681c95e05cd74ab8bc0dd2ea6c43353 (diff) | |
download | fiddle-c2f195a23bdb0d0dc876cc548d4c3157534082c6.tar.gz fiddle-c2f195a23bdb0d0dc876cc548d4c3157534082c6.tar.bz2 fiddle-c2f195a23bdb0d0dc876cc548d4c3157534082c6.zip |
Add backend support and start implementing a C backend.o
Diffstat (limited to 'src/Language/Fiddle/Ast/Internal/SyntaxTree.hs')
-rw-r--r-- | src/Language/Fiddle/Ast/Internal/SyntaxTree.hs | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/Language/Fiddle/Ast/Internal/SyntaxTree.hs b/src/Language/Fiddle/Ast/Internal/SyntaxTree.hs index 1e9ace7..f627f15 100644 --- a/src/Language/Fiddle/Ast/Internal/SyntaxTree.hs +++ b/src/Language/Fiddle/Ast/Internal/SyntaxTree.hs @@ -222,12 +222,17 @@ instance Walk (Directed t stage) where walk fn (Directed directives subtree _) s = do - s' <- fn subtree s - walk fn subtree s' - - forM_ directives $ \d -> do - s' <- fn d s - walk fn d s' + forM_ directives $ \d -> + ( \case + Continue s' -> walk fn d s' + _ -> return () + ) + =<< fn d s + ( \case + Continue s' -> walk fn subtree s' + _ -> return () + ) + =<< fn subtree s -- | Apply a function to the underlying subtree in a 'Directed' type. mapDirected :: (t s f a -> t' s' f a) -> Directed t s f a -> Directed t' s' f a |