package libsail

  1. Overview
  2. Docs
val opt_interactive : bool Stdlib.ref
type istate = {
  1. ast : Type_check.tannot Ast_defs.ast;
  2. effect_info : Effects.side_effect_info;
  3. env : Type_check.Env.t;
  4. default_sail_dir : string;
  5. config : Yojson.Basic.t option;
}

Each interactive command is passed this struct, containing the abstract syntax tree, effect info and the type-checking environment. Also contains the default Sail directory

val initial_istate : Yojson.Basic.t option -> string -> istate
val arg : string -> string
val command : string -> string
type action =
  1. | ArgString of string * string -> action
  2. | ArgInt of string * int -> action
  3. | Action of istate -> istate
  4. | ActionUnit of istate -> unit
val reflect_typ : action -> Ast.typ
val get_command : string -> (string * action) option
val all_commands : unit -> (string * (string * action)) list
val generate_help : string -> string -> action -> string
val run_action : istate -> string -> string -> action -> istate
val register_command : name:string -> help:string -> action -> unit

This is the main function used to register new interactive commands.

OCaml

Innovation. Community. Security.