Module Liquidsoap_lang.Runtime

Main script evaluation

exception Error
type append_stdlib = unit -> stdlib
val type_term : ?name:string -> ?stdlib:append_stdlib -> ?term:Liquidsoap_lang_ast.Term.t -> ?ty:Liquidsoap_lang_types.Type.t -> ?cache_dirtype:Liquidsoap_lang_cache.Cache.dirtype -> cache:bool -> trim:bool -> lib:bool -> Liquidsoap_lang_ast.Parsed_term.t -> Liquidsoap_lang_ast.Term.t

Typecheck a term and return it. Might return a cached value!

val eval_term : ?name:string -> toplevel:bool -> Liquidsoap_lang_ast.Term.t -> Liquidsoap_lang_values.Value.t

Evaluate a term.

val strict : bool Stdlib.ref

Raise errors for warnings.

val deprecated : bool Stdlib.ref

Register deprecated arguments and functions.

val raw_errors : bool Stdlib.ref

Raise raw errors.

val libs : ?error_on_no_stdlib:bool -> ?deprecated:bool -> stdlib:string -> unit -> string list

Return the list of external libraries.

val load_libs : stdlib:string -> unit -> unit

Load the external libraries.

val throw : ?formatter:Stdlib.Format.formatter -> lexbuf:Sedlexing.lexbuf option -> bt:Stdlib.Printexc.raw_backtrace -> unit -> exn -> unit
val program : (unit -> Liquidsoap_lang_parser.Parser.token * Stdlib.Lexing.position * Stdlib.Lexing.position) -> Liquidsoap_lang_ast.Parsed_term.t
val interactive : unit -> unit

Interactive loop: read from command line, eval, print and loop.

Parse a string.

val error_header : formatter:Stdlib.Format.formatter -> int -> Liquidsoap_lang_prelude.Pos.Option.t -> unit
val on_error_print : (formatter:Stdlib.Format.formatter -> exn -> bool) -> unit

Register a printer for exceptions raised by layers above the language, e.g. clock errors from the streaming core. It should return true when it has printed the exception, false to let the next printer try.

val report : ?default:(unit -> 'a) -> lexbuf:Sedlexing.lexbuf option -> (throw:(bt:Stdlib.Printexc.raw_backtrace -> exn -> unit) -> unit -> 'a) -> 'a

Report language errors.