package gobba

  1. Overview
  2. Docs
val run_string : string -> ?dirscope:string -> ?state:Types.evalstate -> unit -> Types.evt * Types.evalstate

Parse and evaluate a gobba expression from a string, in a default state, returning a couple consisting of an evaluated value (of type evt), that you can unpack using the Gobba.Typecheck.unpack_<name>, and the new state resulting from the command evaluation. This is useful for embedding gobba in your ocaml programs.

  • parameter str

    The gobba string to parse and evaluate

  • parameter dirscope

    A directory path: where gobba will look for files imported with a relative path. Defaults to the current directory.

  • parameter state

    Specifies the current computation state with options. Uses the default state (with an empty environment) if not provided

  • returns

    A couple containing the result of the expression evaluation and the resulting state.

val directives : string list
module StringSet : sig ... end
val gen_keywords_from_env : (Types.ide * Types.evt) list -> Types.ide list
val varnames : StringSet.t ref
val read_toplevel : unit -> Types.command list

Read a line from the CLI using ocamline and parse it

val repl_loop : Types.evalstate ref -> int -> bool -> unit
val repl : Types.evalstate -> int -> bool -> unit
val run_file : string -> Types.evalstate -> int -> bool -> Types.evt * Types.evalstate * int

Runs a file, returning the eventual value

  • returns

    The resulting value, state and exit code