@@ -0,0 +1,2 @@
|
|||||||
|
ret > ExitSuccess
|
||||||
|
out > 17
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
ret > ExitSuccess
|
||||||
|
out > 10
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
ret > ExitSuccess
|
||||||
|
out > 1234
|
||||||
@@ -1 +1 @@
|
|||||||
(call/cc (_) 1234)
|
(call/cc (λ (_) 1234))
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ convert (Scm.ExpLit l) k = k $ ValLit l
|
|||||||
-- special case: call/cc is desugared during cps-conversion...
|
-- special case: call/cc is desugared during cps-conversion...
|
||||||
convert (Scm.ExpPrim (PrimCallCC withcc)) k = do
|
convert (Scm.ExpPrim (PrimCallCC withcc)) k = do
|
||||||
convert withcc \withcc' -> do
|
convert withcc \withcc' -> do
|
||||||
callcc <- gensym' @Name "call/cc"
|
|
||||||
cc <- gensym' @Name "cc"
|
cc <- gensym' @Name "cc"
|
||||||
r <- gensym' "r"
|
r <- gensym' "r"
|
||||||
m <- k $ ValVar r
|
m <- k $ ValVar r
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import System.Directory
|
|||||||
import Data.Function
|
import Data.Function
|
||||||
import System.Environment.Blank (getEnvDefault)
|
import System.Environment.Blank (getEnvDefault)
|
||||||
import qualified System.Process.Text as PT
|
import qualified System.Process.Text as PT
|
||||||
import Control.Exception (catches, ErrorCall(..), Handler(..), catch, SomeException (SomeException), Exception (displayException))
|
import Control.Exception (SomeException (SomeException), Exception (..), catch)
|
||||||
import Gyehoek.Stack.VM (writeObj)
|
import Gyehoek.Stack.VM (writeObj)
|
||||||
import Data.Text qualified as T
|
import Data.Text qualified as T
|
||||||
import System.Exit (ExitCode(..))
|
import System.Exit (ExitCode(..))
|
||||||
@@ -25,10 +25,9 @@ brokenWasmTests =
|
|||||||
|
|
||||||
brokenStackifyTests :: List String
|
brokenStackifyTests :: List String
|
||||||
brokenStackifyTests =
|
brokenStackifyTests =
|
||||||
[ "apply-twice"
|
[ "adder"
|
||||||
, "adder"
|
|
||||||
, "apply2"
|
|
||||||
, "let-fn"
|
, "let-fn"
|
||||||
|
, "callcc-nested1" -- requires closure-conversion
|
||||||
]
|
]
|
||||||
|
|
||||||
root :: IO TestTree
|
root :: IO TestTree
|
||||||
@@ -67,12 +66,6 @@ stackifyTests files = do
|
|||||||
let testname = takeFileName test
|
let testname = takeFileName test
|
||||||
scmfile = test </> "source.scm"
|
scmfile = test </> "source.scm"
|
||||||
resultfile = test </> "exec"
|
resultfile = test </> "exec"
|
||||||
-- action = Driver.eval_e2e' scmfile >>= \case
|
|
||||||
-- Right rs ->
|
|
||||||
-- pure ( ExitSuccess
|
|
||||||
-- , T.unwords . fmap writeObj $ rs
|
|
||||||
-- , "" )
|
|
||||||
-- Left e -> pure (ExitFailure 1, "", T.pack $ displayException e)
|
|
||||||
action =
|
action =
|
||||||
catch @SomeException
|
catch @SomeException
|
||||||
(do rs <- Driver.eval_e2e scmfile
|
(do rs <- Driver.eval_e2e scmfile
|
||||||
|
|||||||
Reference in New Issue
Block a user