package catala

  1. Overview
  2. Docs
Compiler and library for the literate programming language for tax code specification

Install

dune-project
 Dependency

Authors

Maintainers

Sources

1.0.0-alpha.tar.gz
md5=2615968670ac21b1d00386a9b04b3843
sha512=eff292fdd75012f26ce7b17020f5a8374eef37cd4dd6ba60338dfbe89fbcad3443d1b409e44c182b740da9f58dff7e76dcb8ddefe47f9b2b160666d1c6930143

doc/catala.shared_ast/Shared_ast/Print/index.html

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