package liquidsoap-lang

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Liquidsoap_lang.Parser_helperSource

Helper functions for the parser.

Sourcetype arglist = (string * string * Type.t * Term.t option) list
Sourcetype lexer_let_decoration = [
  1. | `None
  2. | `Recursive
  3. | `Replaces
  4. | `Eval
  5. | `Json_parse
  6. | `Yaml_parse
]
Sourcetype let_decoration = [
  1. | `None
  2. | `Recursive
  3. | `Replaces
  4. | `Eval
  5. | `Yaml_parse
  6. | `Json_parse of (string * Term.t) list
]
Sourcetype app_list_elem = (string * Term.t) list
Sourcetype binding = {
  1. doc : Doc.Value.t option;
  2. decoration : let_decoration;
  3. pat : Term.pattern;
  4. arglist : arglist option;
  5. def : Term.t;
  6. cast : Type.t option;
}
Sourceval let_args : ?doc:Doc.Value.t -> decoration:let_decoration -> pat:Term.pattern -> ?arglist:arglist -> def:Term.t -> ?cast:Type.t -> unit -> binding
Sourcetype encoder_param = string * [ `Term of Term.t | `Encoder of string * encoder_opt ]
Sourceand encoder_opt = encoder_param list
Sourcetype inner_list_item = [
  1. | `Ellipsis of Term.t
  2. | `Expr of Term.t
]
Sourcetype inner_list = [
  1. | `App of Term.t
  2. | `List of Term.t list
]
Sourcetype let_opt_el = string * Term.t
Sourcetype ty_content_arg = string * string
Sourcetype ty_content_args = ty_content_arg list
Sourcetype ty_content = string * ty_content_args
Sourcetype varlist = [
  1. | `List of Term.t list
  2. | `App of Term.t
]
Sourcetype meth_pattern_el = string * Term.pattern option
Sourcetype meth_ty_opt = {
  1. meth_ty_name : string;
  2. meth_ty_typ : Type.t;
  3. meth_ty_optional : bool;
  4. meth_ty_json_name : string option;
}
Sourceval let_decoration_of_lexer_let_decoration : [< `Eval | `Json_parse | `None | `Recursive | `Replaces | `Yaml_parse ] -> [> `Eval | `Json_parse of 'a list | `None | `Recursive | `Replaces | `Yaml_parse ]
Sourceval string_of_let_decoration : [< `Eval | `Json_parse of 'a | `None | `Recursive | `Replaces | `Yaml_parse ] -> string
Sourceval args_of_json_parse : pos:Pos.t -> (string * 'a) list -> (string * 'a) list
Sourceval gen_args_of : only:string list -> except:string list -> pos:Pos.t -> (pos:Pos.t -> Type.t -> (string * string * Value.t option) list -> 'a) -> string -> 'a
Sourceval args_of : only:string list -> except:string list -> pos:Pos.t -> string -> (string * string * Type.t * Term.t option) list
Sourceval app_of : only:string list -> except:string list -> pos:Pos.t -> string -> (string * Term.t) list
Sourceval mk : ?pos:Pos.t -> ?t:Type.t -> ?methods:Term.term Term.Methods.t -> Term.in_term -> Term.t
Sourceval append_list : pos:Pos.t -> [< `Ellipsis of Term.t | `Expr of Term.t ] -> [< `App of Term.t | `List of Term.t list ] -> [> `App of Term.t | `List of Term.t list ]
Sourceval mk_list : pos:Pos.t -> [< `App of Term.t | `List of Term.t list ] -> Term.t
Sourceval mk_fun : pos:Pos.t -> (string * Term.Vars.elt * Type.t * Term.t option) list -> Term.t -> Term.t
Sourceval mk_app_invoke_default : pos:Pos.t -> args:(Term.Vars.elt * 'a) list -> Term.t -> Term.t

When doing chained calls, we want to update all nested defaults so that, e.g. in: `x?.foo.gni.bla(123)?.gno.gni`, the default for `x.foo` becomes: `any.gni = any.{ bla = fun (_) -> any.{ gno = any.{ gni = null()

}

}

}

` we also need to keep track of which methods are optional in the default value's type to make sure it doesn't force optional methods to be mandatory during type checking.

Sourceval mk_any : pos:Pos.t -> unit -> Term.t
Sourceval mk_invoke_default : pos:Pos.t -> optional:bool -> name:string -> Term.term -> Term.invoke -> Term.t * Term.t
Sourceval update_invoke_default : pos:Pos.t -> optional:bool -> Term.t -> string -> Term.t -> Term.t
Sourceval mk_invoke : ?default:Term.t -> pos:Pos.t -> Term.t -> [< `App of string * (Term.Vars.elt * Term.t) list | `String of string ] -> Term.t
Sourceval mk_coalesce : pos:Pos.t -> default:Term.t -> Term.t -> Term.t
Sourceval mk_let_json_parse : pos:Pos.t -> ((string * Term.t) list * Term.pattern * Term.t * Type.t option) -> Term.t -> Term.t
Sourceval mk_let_yaml_parse : pos:Pos.t -> (Term.pattern * Term.t * Type.t option) -> Term.t -> Term.t
Sourceval mk_rec_fun : pos:Pos.t -> Term.pattern -> (string * Term.Vars.elt * Type.t * Term.t option) list -> Term.t -> Term.t
Sourceval mk_eval : pos:Pos.t -> (Term.doc option * Term.pattern * Term.t * Term.t * Type.t option) -> Term.t
Sourceval mk_let : pos:Pos.t -> binding -> Term.t -> Term.t
Sourceval mk_encoder : pos:Pos.t -> string -> Term.encoder_params -> Term.t

Time intervals

Sourceval time_units : int array
Sourceval date : pos:Pos.t -> int option list -> int

Given a date specified as a list of four values (whms), return a date in seconds from the beginning of the week.

Sourceval last_index : 'a option list -> int

Give the index of the first non-None value in the list.

Sourceval precision : 'a option list -> int

Give the precision of a date-as-list. For example, the precision of Xs is 1, XmYs is 60, XhYmZs 3600, etc.

Sourceval duration : 'a option list -> int

Give the duration of a data-as-list. For example, the duration of Xs is 1, Xm 60, XhYm 60, etc.

Sourceval between : pos:Pos.t -> int option list -> int option list -> int * int * int
Sourceval during : pos:Pos.t -> int option list -> int * int * int
Sourceval mk_time_pred : pos:Pos.t -> (int * int * int) -> Term.t
Sourceval mk_source_ty : pos:Pos.t -> string -> (string * (string * (string * string) list)) list -> extensible:bool -> Type.t
Sourceval mk_json_assoc_object_ty : pos:Pos.t -> (Type.t * string * string * string) -> Type.t
Sourceval mk_ty : pos:Pos.t -> string -> Type.t
Sourceval mk_invoke_ty : pos:Pos.t -> Type.t -> string -> Type.t