At the moment the CakeML/Candle REPL is user configurable through the following references.
|
This Repl module defines some references: |
|
- Repl.isEOF : bool ref |
|
-- true means that all user input has been read (e.g. if we have |
|
reached the end of stdin) |
|
- Repl.nextString : string ref |
|
-- contains the next user input (if isEOF is false) |
|
- Repl.readNextString : (unit -> unit) ref |
|
-- the function that the Repl uses to read user input; it is this |
|
function that assigns new values to Repl.isEOF and Repl.nextString |
|
- Repl.exn : exn |
|
-- the most recent exception to propagate to the top |
Repl.readNextString holds a function that populates Repl.isEOF : bool ref and Repl.nextString : string ref.
This issue is about:
- changing the type of
Repl.nextString to (string + Ast.dec list) ref
- moving the OCaml parser from the bootstrap translation to the candle boot files
In the new setting, the CakeML/Candle REPL starts by reading the initial input from a boot file written in CakeML concrete syntax. This file can be used to define a new parser, e.g., an OCaml parser. The new parser can then be put to use by updating Repl.readNextString : (unit -> unit) ref so that it parses input using the new parser and assigns it to the Ast.dec list option of Repl.nextString.
Perhaps Repl.nextString should be renamed to Repl.nextInput.
At the moment the CakeML/Candle REPL is user configurable through the following references.
cakeml/compiler/repl/repl_moduleProgScript.sml
Lines 10 to 20 in 77cbb88
Repl.readNextStringholds a function that populatesRepl.isEOF : bool refandRepl.nextString : string ref.This issue is about:
Repl.nextStringto(string + Ast.dec list) refIn the new setting, the CakeML/Candle REPL starts by reading the initial input from a boot file written in CakeML concrete syntax. This file can be used to define a new parser, e.g., an OCaml parser. The new parser can then be put to use by updating
Repl.readNextString : (unit -> unit) refso that it parses input using the new parser and assigns it to theAst.dec listoption ofRepl.nextString.Perhaps
Repl.nextStringshould be renamed toRepl.nextInput.