Liquidsoap_tooling.AnalysisTypecheck a script without running it, for editor tooling. Nothing here prints or exits.
type diagnostic = {severity : [ `Warning | `Error ];code : int;pos : Liquidsoap_lang_prelude.Pos.t option;message : string;}type env = (string * Liquidsoap_lang_types.Type.scheme) listtype result = {diagnostics : diagnostic list;term : Liquidsoap_lang_ast.Term.t option;The typed script, when it parsed. Each type error in it is replaced with a placeholder that typechecks as any type.
*)file : string;The script's name, which its own positions carry.
*)}val load_env : string -> envRaises Failure unless dump was written in the current Liquidsoap_lang_types.Jsoo_safe_env.abi_version.
file names the script, so that %include resolves next to it.
val type_at : result -> line:int -> column:int -> string optionThe type of the innermost subterm at a 1-based line and a byte column.
val locals_at : result -> line:int -> column:int -> string listThe names the script binds around a position, in enclosing definitions and functions. They shadow the environment's names of the same spelling.
The names a script can write that are in scope at a position: the environment's, and locals_at.
val methods_at : result -> line:int -> column:int -> (string * string) listThe methods of the innermost subterm's type at a position, with their types.
val definition_at :
result ->
line:int ->
column:int ->
Liquidsoap_lang_prelude.Pos.t optionWhere the variable at a position is bound in the script: by a definition, or as a function's argument. None for the environment's names.
val null_methods : env:env -> (string * string) listThe methods of null.m, which no script can shadow.