package catala

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

Printing functions for the default calculus AST

Common syntax highlighting helpers

val base_type : Stdlib.Format.formatter -> string -> unit
val keyword : Stdlib.Format.formatter -> string -> unit
val punctuation : Stdlib.Format.formatter -> string -> unit

The argument is assumed to be 1-column wide (but can be a multi-char utf8 character)

val op_style : Stdlib.Format.formatter -> string -> unit
val lit_style : Stdlib.Format.formatter -> string -> unit

Some basic stringifiers

val operator_to_string : 'a Shared_ast__.Definitions.Op.t -> string

Prints the operator symbols with kind suffixes, as expected by the OCaml backend (e.g. "+^", "+$", etc.)

Formatters

val uid_list : Stdlib.Format.formatter -> Catala_utils.Uid.MarkedString.info list -> unit
val tlit : Stdlib.Format.formatter -> Shared_ast__.Definitions.typ_lit -> unit
val location : Stdlib.Format.formatter -> 'a Shared_ast__.Definitions.glocation -> unit
val external_ref : Stdlib.Format.formatter -> Shared_ast__.Definitions.external_ref Catala_utils.Mark.pos -> unit
val typ : Shared_ast__.Definitions.decl_ctx -> Stdlib.Format.formatter -> Shared_ast__.Definitions.naked_typ Catala_utils.Mark.pos -> unit
val lit : Stdlib.Format.formatter -> Shared_ast__.Definitions.lit -> unit
val operator : ?debug:bool -> Stdlib.Format.formatter -> 'a Shared_ast__.Definitions.Op.t -> unit
val log_entry : Stdlib.Format.formatter -> Shared_ast__.Definitions.log_entry -> unit
val except : Stdlib.Format.formatter -> Shared_ast__.Definitions.except -> unit
val var : Stdlib.Format.formatter -> 'e Var.t -> unit
val var_debug : Stdlib.Format.formatter -> 'e Var.t -> unit
val expr : ?debug:bool -> unit -> Stdlib.Format.formatter -> (('a, 'a, 'm) Shared_ast__.Definitions.base_gexpr, 'm Shared_ast__.Definitions.mark) Catala_utils.Mark.ed -> unit

Expression printer.

  • parameter debug

    (default to the global setting) turns on printing of logging nodes, variable indices and operator suffixes. See the interface below for more detailed control.

Generic expression printer interface

module type EXPR_PARAM = sig ... end
module ExprGen (_ : EXPR_PARAM) : sig ... end

Debugging versions that don't require a context

val typ_debug : Stdlib.Format.formatter -> Shared_ast__.Definitions.naked_typ Catala_utils.Mark.pos -> unit
val scope : ?debug:bool -> Shared_ast__.Definitions.decl_ctx -> Stdlib.Format.formatter -> (Shared_ast__.Definitions.ScopeName.t * (('a, 'a, 'm) Shared_ast__.Definitions.base_gexpr, 'm Shared_ast__.Definitions.mark) Catala_utils.Mark.ed Shared_ast__.Definitions.scope_body) -> unit
val program : ?debug:bool -> Stdlib.Format.formatter -> (('a, 'a, 'm) Shared_ast__.Definitions.base_gexpr, 'm Shared_ast__.Definitions.mark) Catala_utils.Mark.ed Shared_ast__.Definitions.program -> unit
module UserFacing : sig ... end

User-facing, localised printer

/

val skip_wrappers : (('a, 'a, 'm) Shared_ast__.Definitions.base_gexpr, 'm Shared_ast__.Definitions.mark) Catala_utils.Mark.ed -> (('a, 'a, 'm) Shared_ast__.Definitions.base_gexpr, 'm Shared_ast__.Definitions.mark) Catala_utils.Mark.ed

This is exported from Expr, but first defined here for dependency reasons

OCaml

Innovation. Community. Security.