package libsail

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
module type PRINT_CONFIG = sig ... end

The PRINT_CONFIG module type can be used to customise the behavior of the pretty-printer

module Printer (Config : PRINT_CONFIG) : sig ... end

The Printer functor defines the printing function based on the supplied printing configuration

val reformat : into_directory:string -> Ast_util.untyped_ast -> unit

This function is intended to reformat machine-generated Sail into something a bit more readable, it is not intended to be used as a general purpose code formatter. The output will be dumped as multiple files into the directory argument.

The default PRINT_CONFIG sets all the options to false, so it prints the AST 'as is' without modifications.

For convenience, other modules can get the default behavior by just importing this module.

include sig ... end
val doc_id : Ast.id -> PPrint.document
val doc_typ : Ast.typ -> PPrint.document
val doc_binding : (Ast.typquant * Ast.typ) -> PPrint.document
val doc_typschm : Ast.typschm -> PPrint.document
val doc_exp : Ast_util.uannot Ast.exp -> PPrint.document
val doc_block : Ast_util.uannot Ast.exp list -> PPrint.document
val doc_letbind : Ast_util.uannot Ast.letbind -> PPrint.document
val doc_funcl : Ast_util.uannot Ast.funcl -> PPrint.document
val doc_mapcl : Ast_util.uannot Ast.mapcl -> PPrint.document
val doc_spec : Ast_util.uannot Ast.val_spec -> PPrint.document
val doc_type_def : Ast_util.uannot Ast.type_def -> PPrint.document
val doc_register : Ast_util.uannot Ast.dec_spec -> PPrint.document
val doc_def : Ast_util.untyped_def -> PPrint.document
val output_ast : ?line_width:int -> Stdlib.out_channel -> Ast_util.untyped_ast -> unit

This function is primarly used to dump the AST by debug options, such as --ddump-tc-ast.

module Document : sig ... end

Some convenience functions for outputting PPrint documents

OCaml

Innovation. Community. Security.