Module Lice.LState

type t

The type of the Lice state. Contains everything needed for the Lice VM to run, as well as some other metadata.

val empty : t

empty creates an empty state.

val set_logs : t -> int -> t

set_logs lstate l sets the logs level of the Lice interpreter to l where l is between 0 and 2.

Value

Level

0 (default value)

Prints out Warnings and Errors only

1 (debug)

Prints out Warnings, Errors and Debug log messages

2 (verbose)

Prints out Warnings, Errors, Debug and Info log messages

val do_string : t -> string -> t

do_string lstate code reads the string code as code, compiles it and execute it inside the lstate context.

val do_file : t -> string -> t

dofile lstate file reads the file string as a file path and then execute the content inside the lstate context as Lice code