package libsail

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

Module Libsail.Initial_checkSource

Initial desugaring pass over AST after parsing

Options

Sourceval opt_strict_bitvector : bool ref

If enabled, bitvector types are only well-formed if their arguments are natural numbers.

Sourceval opt_fast_undefined : bool ref

Generate faster undefined_T functions. Rather than generating functions that allow for the undefined values of enums and variants to be picked at runtime using a RNG or similar, this creates undefined_T functions for those types that simply return a specific member of the type chosen at compile time, which is much faster. These functions don't have the right effects, so the -no_effects flag may be needed if this is true. False by default.

Sourceval opt_magic_hash : bool ref

Allow # in identifiers when set, much like the GHC option of the same name

Contexts

Sourcetype ctx
Sourceval merge_ctx : Parse_ast.l -> ctx -> ctx -> ctx
Sourceval initial_ctx : ctx

Desugar and process AST

Sourceval to_ast_typ_arg : Ast.kind_aux -> ctx -> Parse_ast.atyp -> Ast.typ_arg
Sourceval get_uninitialized_registers : Ast_util.untyped_def list -> (Ast.id * Ast.typ) list
Sourceval generate_undefined_record_context : Ast.typquant -> (Ast.id * Ast.typ) list
Sourceval generate_undefined_record : Ast.id -> Ast.typquant -> (Ast.typ * Ast.id) list -> Ast_util.untyped_def list
Sourceval generate_undefined_enum : Ast.id -> Ast.id list -> Ast_util.untyped_def list
Sourceval undefined_builtin_val_specs : unit -> Ast_util.untyped_def list

Val specs of undefined functions for builtin types that get added to the AST by generate_undefinds (minus those functions that already exist in the AST).

Sourceval generate_undefineds : Ast_util.IdSet.t -> Ast_util.untyped_def list
Sourceval generate_initialize_registers : Ast_util.IdSet.t -> (Ast.id * Ast.typ) list -> Ast_util.untyped_def list
Sourceval generate_enum_number_conversions : Ast_util.untyped_def list -> Ast_util.untyped_def list

Parsing expressions and definitions from strings

Sourceval extern_of_string : ?pure:bool -> Ast.id -> string -> Ast_util.untyped_def
Sourceval val_spec_of_string : Ast.id -> string -> Ast_util.untyped_def
Sourceval defs_of_string : (string * int * int * int) -> ctx -> string -> Ast_util.untyped_def list * ctx
Sourceval ast_of_def_string : ?inline:Lexing.position -> (string * int * int * int) -> ctx -> string -> Ast_util.untyped_ast * ctx
Sourceval ast_of_def_string_with : ?inline:Lexing.position -> (string * int * int * int) -> ctx -> (Parse_ast.def list -> Parse_ast.def list) -> string -> Ast_util.untyped_ast * ctx
Sourceval exp_of_string : ?inline:Lexing.position -> string -> Ast_util.uannot Ast.exp
Sourceval typ_of_string : ?inline:Lexing.position -> string -> Ast.typ
Sourceval constraint_of_string : ?inline:Lexing.position -> string -> Ast.n_constraint
Sourceval parse_from_string : (Lexing.lexbuf -> 'a) -> ?inline:Lexing.position -> string -> 'a

Parsing files

Sourceval parse_file : ?loc:Parse_ast.l -> string -> Lexer.comment list * Parse_ast.def list

Parse a file into a sequence of comments and a parse AST

  • parameter ?loc

    If we get an error reading the file, report the error at this location

Sourceval get_lexbuf_from_string : filename:string -> contents:string -> Lexing.lexbuf
Sourceval parse_file_from_string : filename:string -> contents:string -> Lexer.comment list * Parse_ast.def list
Sourceval parse_project : ?inline:Lexing.position -> ?filename:string -> contents:string -> unit -> Project.def Project.spanned list
OCaml

Innovation. Community. Security.