Commit 58384346 authored by Michael Hanus's avatar Michael Hanus
Browse files

Fixes w.r.t. legacy mode

parent 71a580c7
......@@ -80,10 +80,13 @@ The actual options are specified by data of type `CCOption`
Print Bindings:
---------------
When `+bindings` is on, the values of variables that are free in the to-be-evaluated expression will be shown.
If the compiler supports the flags `-B` to enable it and`-V` for passing variable names via command line,
the compiler is responsible for showing these bindings.
For compilers that do not support this, the REPL will handle it in a limited way.
When `+bindings` is on, the values of variables that are free in the
to-be-evaluated expression will be shown. If the compiler supports
the flags `-B` to enable it and`-V` for passing variable names via
command line, the compiler is responsible for showing these bindings.
For compilers that do not support this, the REPL will handle it in a
limited way.
RC file:
--------
......
......@@ -5,7 +5,7 @@
--- > cypm curry :l C2GoREPL.curry :save :q
---
--- @author Michael Hanus
--- @version October 2021
--- @version August 2022
------------------------------------------------------------------------------
module C2GoREPL where
......@@ -48,6 +48,7 @@ c2go = CCDescription
(\s -> "--compile " ++ s) -- option to compile only
(\s -> "--noimports " ++ s) -- option to create an executable
cleanCmd -- command to clean module
LegacyFreeMode
[stratOpt, intOpt, firstOpt, resultsOpt, errDepthtOpt]
where
cleanCmd m =
......
......@@ -7,7 +7,7 @@
--- > cypm curry :l JucsREPL.curry :save :q
---
--- @author Michael Hanus
--- @version February 2022
--- @version August 2022
------------------------------------------------------------------------------
module JucsREPL where
......@@ -41,6 +41,7 @@ jucs = CCDescription
(\s -> s) -- option to compile only
(\s -> "--standalone -m main " ++ s) -- option to create an executable
cleanCmd -- command to clean module
LegacyFreeMode
[stratOpt, intOpt, firstOpt]
where
cleanCmd m =
......
......@@ -5,7 +5,7 @@
--- > cypm curry :l PakcsREPL.curry :save :q
---
--- @author Michael Hanus
--- @version February 2022
--- @version August 2022
------------------------------------------------------------------------------
module PakcsREPL where
......@@ -48,6 +48,7 @@ pakcs = CCDescription
(\s -> ":compile " ++ s ++ " :quit") -- option to compile only
(\s -> ":load " ++ s ++ " :save :quit") -- option to create an executable
cleanCmd -- command to clean module
LegacyFreeMode
[intOpt, firstOpt, printDepthtOpt]
where
cleanCmd m =
......
......@@ -6,7 +6,7 @@
--- a JSON file) or statically defined in some module.
---
--- @author Michael Hanus
--- @version July 2021
--- @version August 2022
------------------------------------------------------------------------------
module REPL.Compiler where
......
......@@ -2,7 +2,7 @@
--- A universal REPL which can be used on top of a Curry compiler
---
--- @author Michael Hanus
--- @version July 2022
--- @version August 2022
------------------------------------------------------------------------------
module REPL.Main where
......@@ -1021,7 +1021,7 @@ insertFreeVarsShowInMainExp rst (CurryProg _ _ _ _ _ _ fdecls _) mainexp = do
(\p -> return $ Just (p,freevarexp,[]))
else if isLegacyFreeMode (freeMode rst)
then do
let freevarexp = addFreeShowLegacy exp freevars "" ty
let freevarexp = addFreeShowLegacy exp freevars whereclause ty
writeVerboseInfo rst 2 $
"Adding printing of bindings for free variables: " ++
intercalate "," freevars
......@@ -1260,7 +1260,8 @@ curryCompilerCommand rst vs = unwords [ccExec (compiler rst), cmpopts]
else [(ccParseOpt (compiler rst)) (parseOpts rst)]) ++
(case freeMode rst of
LegacyFreeMode -> []
CommandLineFreeMode trans -> [trans (zip vs [1..])] ++ [ "-B" | showBindings rst])
CommandLineFreeMode trans -> [trans (zip vs [1..])] ++
[ "-B" | showBindings rst])
--- Extract a module name, possibly prefixed by a path, from an argument,
--- or return the current module name if the argument is the empty string.
......
......@@ -2,7 +2,7 @@
--- The state of the REPL.
---
--- @author Michael Hanus
--- @version October 2021
--- @version August 2022
------------------------------------------------------------------------------
module REPL.State where
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment