Merge pull request #584 from hellerve/deprecate-project-set

Remove project-set!
This commit is contained in:
Erik Svedäng 2019-10-07 12:33:33 +02:00 committed by GitHub
commit 98e046a3bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 44 deletions

View File

@ -1473,25 +1473,6 @@
</p>
</div>
<div class="binder">
<a class="anchor" href="#project-set!">
<h3 id="project-set!">
project-set!
</h3>
</a>
<div class="description">
command
</div>
<p class="sig">
Dynamic
</p>
<span>
</span>
<p class="doc">
</p>
</div>
<div class="binder">
<a class="anchor" href="#quit">
<h3 id="quit">

View File

@ -79,30 +79,6 @@ addCommandConfigurable name maybeArity callback =
unwrap $ return (Left (EvalError ("Invalid args to '" ++ name ++ "' command: " ++ joinWithComma (map pretty args)) Nothing))
withoutArity args = unwrap $ callback args
-- | DEPRECATED Command for changing various project settings.
commandProjectSet :: CommandCallback
commandProjectSet [XObj (Str key) _ _, value] =
do ctx <- get
let proj = contextProj ctx
env = contextGlobalEnv ctx
case value of
XObj (Str valueStr) _ _ -> do
newCtx <- case key of
"cflag" -> return ctx { contextProj = proj { projectCFlags = addIfNotPresent valueStr (projectCFlags proj) } }
"libflag" -> return ctx { contextProj = proj { projectLibFlags = addIfNotPresent valueStr (projectLibFlags proj) } }
"prompt" -> return ctx { contextProj = proj { projectPrompt = valueStr } }
"search-path" -> return ctx { contextProj = proj { projectCarpSearchPaths = addIfNotPresent valueStr (projectCarpSearchPaths proj) } }
-- TODO: should these be booleans?
"printAST" -> return ctx { contextProj = proj { projectPrintTypedAST = valueStr == "true" } }
"echoC" -> return ctx { contextProj = proj { projectEchoC = valueStr == "true" } }
"echoCompilationCommand" -> return ctx { contextProj = proj { projectEchoCompilationCommand = valueStr == "true" } }
"compiler" -> return ctx { contextProj = proj { projectCompiler = valueStr } }
"title" -> return ctx { contextProj = proj { projectTitle = valueStr } }
_ -> presentError ("Unrecognized key: '" ++ key ++ "'") ctx
put newCtx
return dynamicNil
val -> presentError "Argument to project-set! must be a string" dynamicNil
presentError :: MonadIO m => String -> a -> m a
presentError msg ret =
liftIO $ do putStrLnWithColor Red msg

View File

@ -239,7 +239,6 @@ dynamicModule = Env { envBindings = bindings
, addCommand "project" 0 commandProject
, addCommand "load" 1 commandLoad
, addCommand "expand" 1 commandExpand
, addCommand "project-set!" 2 commandProjectSet
, addCommand "os" 0 commandOS
, addCommand "system-include" 1 commandAddSystemInclude
, addCommand "relative-include" 1 commandAddRelativeInclude