package catala

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

Module Shared_ast.PrintSource

Printing functions for the default calculus AST

Common syntax highlighting helpers

Sourceval base_type : Format.formatter -> string -> unit
Sourceval keyword : Format.formatter -> string -> unit
Sourceval punctuation : Format.formatter -> string -> unit

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

Sourceval op_style : Format.formatter -> string -> unit
Sourceval lit_style : Format.formatter -> string -> unit

Some basic stringifiers

Sourceval 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

Sourceval tlit : Format.formatter -> Shared_ast__.Definitions.typ_lit -> unit
Sourceval location : Format.formatter -> 'a Shared_ast__.Definitions.glocation -> unit
Sourceval external_ref : Format.formatter -> Shared_ast__.Definitions.external_ref Catala_utils.Mark.pos -> unit
Sourceval typ : Format.formatter -> Shared_ast__.Definitions.naked_typ Catala_utils.Mark.pos -> unit
Sourceval tvar : Format.formatter -> Shared_ast__.Definitions.naked_typ Bindlib.var -> unit
Sourceval lit : Format.formatter -> Shared_ast__.Definitions.lit -> unit
Sourceval operator : ?debug:bool -> Format.formatter -> 'a Shared_ast__.Definitions.Op.t -> unit
Sourceval log_entry : Format.formatter -> Shared_ast__.Definitions.log_entry -> unit
Sourceval runtime_error : Format.formatter -> Catala_runtime.error -> unit
Sourceval var : Format.formatter -> 'e Var.t -> unit
Sourceval var_debug : Format.formatter -> 'e Var.t -> unit
Sourceval expr : ?debug:bool -> unit -> 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.

Sourceval s_expr : Format.formatter -> ((_, _, _) Shared_ast__.Definitions.base_gexpr, _ Shared_ast__.Definitions.mark) Catala_utils.Mark.ed -> unit

S-expression printer for all AST nodes.

Generic expression printer interface

Sourcemodule type EXPR_PARAM = sig ... end
Sourcemodule ExprGen (_ : EXPR_PARAM) : sig ... end
Sourceval decl_ctx : ?debug:bool -> Format.formatter -> Shared_ast__.Definitions.decl_ctx -> unit
Sourceval scope : ?debug:bool -> Format.formatter -> (string * (('a, 'a, 'm) Shared_ast__.Definitions.base_gexpr, 'm Shared_ast__.Definitions.mark) Catala_utils.Mark.ed Shared_ast__.Definitions.scope_body) -> unit
Sourceval program : ?debug:bool -> Format.formatter -> (('a, 'a, 'm) Shared_ast__.Definitions.base_gexpr, 'm Shared_ast__.Definitions.mark) Catala_utils.Mark.ed Shared_ast__.Definitions.program -> unit
Sourcemodule UserFacing : sig ... end

User-facing, localised printer

/

Sourceval 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