Skip to content

Commit

Permalink
Remove code related to unused LetEnabled option.
Browse files Browse the repository at this point in the history
Fixes #901.
  • Loading branch information
Brian Huffman committed Sep 23, 2020
1 parent 8d3f10a commit c6e9739
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
5 changes: 1 addition & 4 deletions src/Cryptol/REPL/Command.hs
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,7 @@ getEvalOpts =

evalCmd :: String -> REPL ()
evalCmd str = do
letEnabled <- getLetEnabled
ri <- if letEnabled
then replParseInput str
else P.ExprInput <$> replParseExpr str
ri <- replParseInput str
case ri of
P.ExprInput expr -> do
(val,_ty) <- replEvalExpr expr
Expand Down
17 changes: 0 additions & 17 deletions src/Cryptol/REPL/Monad.hs
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ module Cryptol.REPL.Monad (
, shouldContinue
, unlessBatch
, asBatch
, disableLet
, enableLet
, getLetEnabled
, validEvalContext
, updateREPLTitle
, setUpdateREPLTitle
Expand Down Expand Up @@ -158,9 +155,6 @@ data RW = RW
, eLogger :: Logger
-- ^ Use this to send messages to the user

, eLetEnabled :: Bool
-- ^ Should we allow `let` on the command line

, eUpdateTitle :: REPL ()
-- ^ Execute this every time we load a module.
-- This is used to change the title of terminal when loading a module.
Expand All @@ -180,7 +174,6 @@ defaultRW isBatch l = do
, eModuleEnv = env
, eUserEnv = mkUserEnv userOptions
, eLogger = l
, eLetEnabled = True
, eUpdateTitle = return ()
, eProverConfig = Left SBV.defaultProver
}
Expand Down Expand Up @@ -444,16 +437,6 @@ asBatch body = do
modifyRW_ $ (\ rw -> rw { eIsBatch = wasBatch })
return a

disableLet :: REPL ()
disableLet = modifyRW_ (\ rw -> rw { eLetEnabled = False })

enableLet :: REPL ()
enableLet = modifyRW_ (\ rw -> rw { eLetEnabled = True })

-- | Are let-bindings enabled in this REPL?
getLetEnabled :: REPL Bool
getLetEnabled = fmap eLetEnabled getRW

-- | Is evaluation enabled. If the currently focused module is
-- parameterized, then we cannot evalute.
validEvalContext :: T.FreeVars a => a -> REPL ()
Expand Down

0 comments on commit c6e9739

Please sign in to comment.