From 6c29f3779ac7f01cae2697992e104755108d6eb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Madeleine=20Sydney=20=C5=9Alaga?= Date: Thu, 20 Aug 2026 18:27:36 -0600 Subject: [PATCH] fix completions --- flake.nix | 5 +++++ src/Gyehoek/Driver.hs | 14 ++++++-------- src/Gyehoek/Options.hs | 1 + 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/flake.nix b/flake.nix index b3f31ed..a6cb716 100644 --- a/flake.nix +++ b/flake.nix @@ -55,6 +55,11 @@ guile rust-analyzer wasmtime + # bashInteractive is necessary to work around an + # optparse-applicative issue + # + # https://github.com/pcapriotti/optparse-applicative/pull/408 + bashInteractive ]; }; }; diff --git a/src/Gyehoek/Driver.hs b/src/Gyehoek/Driver.hs index ff1e7d4..bb2e8a3 100644 --- a/src/Gyehoek/Driver.hs +++ b/src/Gyehoek/Driver.hs @@ -77,8 +77,6 @@ inspectWasm wat = do let wasmtools_cfg = proc "wasm-tools" ["print", "-pf", "--print-operand-stack" ,"--color", "always", "-"] - -- & setStdin (byteStringInput . view lazy . encodeUtf8 $ wat) - -- & setStdout byteStringOutput & setStdin createPipe & setStdout createPipe & setStderr inherit @@ -128,12 +126,12 @@ driver opts = do (eval >>> fmap writeObj >>> T.unwords >>> hPutStrLn FS.stdout) - dumpOrRun False (rt_is #CPS) - (pure closedCps) - (const $ pure ()) - (CPS.evalProgram >>> fmap writeObj - >>> T.unwords - >>> hPutStrLn FS.stdout) + when (rt_is #CPS) do + closedCps + & CPS.evalProgram + & fmap writeObj + & T.unwords + & hPutStrLn FS.stdout dumpOrRun opts.inspectWasm (rt_is #Wasm) (lowerProgram cps) inspectWasm diff --git a/src/Gyehoek/Options.hs b/src/Gyehoek/Options.hs index 09d717e..064ef15 100644 --- a/src/Gyehoek/Options.hs +++ b/src/Gyehoek/Options.hs @@ -53,6 +53,7 @@ parser = do , short 'o' , metavar "FILE" , value "-" + , action "file" ] sourceFile <- argument str . fold $ [ metavar "FILE"