From 2c36358babc0c37ac0c21778f0ab46b8ea75a598 Mon Sep 17 00:00:00 2001 From: Lukasz Czajka Date: Thu, 30 Mar 2023 11:24:31 +0200 Subject: [PATCH] enable recursion for Geb --- src/Juvix/Compiler/Backend/Geb/Pretty/Base.hs | 2 +- src/Juvix/Compiler/Core/Transformation/CheckGeb.hs | 14 +------------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/Juvix/Compiler/Backend/Geb/Pretty/Base.hs b/src/Juvix/Compiler/Backend/Geb/Pretty/Base.hs index 9fa7aab8ac..b7df8be025 100644 --- a/src/Juvix/Compiler/Backend/Geb/Pretty/Base.hs +++ b/src/Juvix/Compiler/Backend/Geb/Pretty/Base.hs @@ -144,7 +144,7 @@ instance PrettyCode Binop where instance PrettyCode Failure where ppCode Failure {..} = do - ty <- ppCode _failureType + ty <- ppArg _failureType return $ kwFail <+> ppStringLit _failureMessage <+> ty instance PrettyCode Var where diff --git a/src/Juvix/Compiler/Core/Transformation/CheckGeb.hs b/src/Juvix/Compiler/Core/Transformation/CheckGeb.hs index d8970267a9..dcdc808c28 100644 --- a/src/Juvix/Compiler/Core/Transformation/CheckGeb.hs +++ b/src/Juvix/Compiler/Core/Transformation/CheckGeb.hs @@ -1,7 +1,6 @@ module Juvix.Compiler.Core.Transformation.CheckGeb where import Data.HashMap.Strict qualified as HashMap -import Juvix.Compiler.Core.Data.IdentDependencyInfo import Juvix.Compiler.Core.Data.TypeDependencyInfo import Juvix.Compiler.Core.Error import Juvix.Compiler.Core.Extra @@ -12,8 +11,7 @@ import Juvix.Data.PPOutput checkGeb :: forall r. Member (Error CoreError) r => InfoTable -> Sem r InfoTable checkGeb tab = - checkNoRecursion - >> checkNoRecursiveTypes + checkNoRecursiveTypes >> mapAllNodesM checkNoIO tab >> mapAllNodesM checkBuiltins tab >> mapAllNodesM checkTypes tab @@ -82,16 +80,6 @@ checkGeb tab = _ -> return node _ -> return node - checkNoRecursion :: Sem r () - checkNoRecursion = - when (isCyclic (createIdentDependencyInfo tab)) $ - throw - CoreError - { _coreErrorMsg = ppOutput "recursion not supported for the GEB target", - _coreErrorNode = Nothing, - _coreErrorLoc = defaultLoc - } - checkNoRecursiveTypes :: Sem r () checkNoRecursiveTypes = when (isCyclic (createTypeDependencyInfo tab)) $