Module Liquidsoap_lang_parser.Parser_helper

Term constructors used by the grammar's actions.

Helper functions for the parser.

type lexer_let_decoration = [
  1. | `Eval
  2. | `Json_parse
  3. | `None
  4. | `Recursive
  5. | `Replaces
  6. | `Yaml_parse
  7. | `Xml_parse
  8. | `Sqlite_row
  9. | `Sqlite_query
]
type let_opt_el = string * Liquidsoap_lang_ast.Parsed_term.t
val clear_comments : unit -> unit
val get_pending_comments : unit -> (pos * string list) list
val append_comment : pos:pos -> string -> unit
val attach_comments : Liquidsoap_lang_ast.Parsed_term.t -> unit

A block where an expression is expected. A single-expression block is returned unwrapped, which is the common case (`if a then`, `def f() = e end`) and keeps the AST free of redundant `Block` nodes.

Reinterpret a bare binding's left-hand side, parsed as an expression, as a pattern plus an optional type annotation. Raises Term.Parse_error if it is not a valid target.

val let_decoration_of_lexer_let_decoration : lexer_let_decoration -> Liquidsoap_lang_ast.Parsed_term.let_decoration
val expect_keyword : pos:pos -> string -> string -> unit

Check a contextual keyword's spelling, e.g. the `as` of `as json.object`. Raises Term.Parse_error naming what was expected.

val args_of_json_parse : pos:pos -> (string * 'a) list -> (string * 'a) list
val render_string : pos:pos -> (char * string) -> string