Wax_lang.AstSourceWax Abstract Syntax Tree.
type location = Wax_utils.Ast.location = {loc_start : Lexing.position;loc_end : Lexing.position;}include sig ... endtype nonrec limits = {mi : Wax_utils.Uint64.t;ma : Wax_utils.Uint64.t option;address_type : [ `I32 | `I64 ];page_size_log2 : int option;}The reserved field name marking a .. splice at the head of a struct definition (inherits the supertype's fields). Not a valid identifier, so it never collides with a real field.
Whether a struct field is the .. splice sentinel.
Build a .. splice sentinel field at the given location.
Signage for integer operations.
Unary operators.
Binary operators.
Helper to format signed types (e.g., "i32_s_strict").
A match arm pattern: a (optionally bound) reference-type test, or a null test. See the Match node and Ast_utils.lower_match.
type 'info instr_desc = | Block of {}| Loop of {}| While of {label : label option;cond : 'info instr;step : 'info instr option;block : ('info instr list, location) annotated;}| If of {label : label option;typ : functype;cond : 'info instr;if_block : ('info instr list, location) annotated;else_block : ('info instr list, location) annotated option;}| TryTable of {label : label option;typ : functype;catches : catch list;block : ('info instr list, location) annotated;}| Try of {label : label option;typ : functype;block : ('info instr list, location) annotated;catches : (ident * ('info instr list, location) annotated) list;catch_all : ('info instr list, location) annotated option;}The deprecated legacy exception handler (try_legacy), compiling to the legacy try/catch instructions.
| TryCatch of {label : label option;typ : functype;block : ('info instr list, location) annotated;arms : 'info trycatch_arm list;}The structured try { … } catch { tag => { … } … }, lowering to try_table plus a block ladder. Arms are honest trailing code in clause order: an arm's completion falls into the next arm, the last arm's into the join; the body's completion escapes past all arms. The label (the join) is a block-like exit carrying the result.
| Unreachable| Nop| Hole| Null| Get of ident| Path of ident * ident| Set of ident * (binop, location) annotated option * 'info instr| Tee of ident * 'info instr| Call of 'info instr * 'info instr list| TailCall of 'info instr * 'info instr list| Labelled of ident * 'info instr| Char of Uchar.t| String of ident option * string| Int of string| Float of string| Cast of 'info instr * casttype| CastDesc of 'info instr * bool * 'info instr| Test of 'info instr * reftype| NonNull of 'info instr| Struct of ident option * (ident * 'info instr option) list| StructDefault of ident option| StructDesc of 'info instr * (ident * 'info instr option) list| StructDefaultDesc of 'info instr| StructGet of 'info instr * ident| GetDescriptor of 'info instr| StructSet of 'info instr * ident * 'info instr| Array of ident option * 'info instr * 'info instr| ArrayDefault of ident option * 'info instr| ArrayFixed of ident option * 'info instr list| ArraySegment of ident option * ident * 'info instr * 'info instr| ArrayGet of 'info instr * 'info instr| ArraySet of 'info instr * 'info instr * 'info instr| BinOp of (binop, location) annotated * 'info instr * 'info instr| UnOp of (unop, location) annotated * 'info instr| Let of (ident option * valtype option) list * 'info instr option| Br of label * 'info instr option| Br_if of label * 'info instr| Br_table of label list * 'info instr| Dispatch of {index : 'info instr;cases : label list;default : label;arms : (label * ('info instr list, location) annotated) list;}| Match of {scrutinee : 'info instr;arms : (match_pattern * ('info instr list, location) annotated) list;default : ('info instr list, location) annotated;}| Br_on_null of label * 'info instr| Br_on_non_null of label * 'info instr| Br_on_cast of label * reftype * 'info instr| Br_on_cast_fail of label * reftype * 'info instr| Br_on_cast_desc_eq of label * bool * 'info instr * 'info instr| Br_on_cast_desc_eq_fail of label * bool * 'info instr * 'info instr| Hinted of bool * 'info instr| Throw of ident * 'info instr list| ThrowRef of 'info instr| ContNew of ident * 'info instr| ContBind of ident * ident * 'info instr list| Suspend of ident * 'info instr list| Resume of ident * on_clause list * 'info instr list| ResumeThrow of ident * ident * on_clause list * 'info instr list| ResumeThrowRef of ident * on_clause list * 'info instr list| Switch of ident * ident * 'info instr list| On of 'info instr * on_clause listThe postfix handler clause e on [t -> 'l, ...] as parsed; the typer folds it into the Resume/ResumeThrow/ResumeThrowRef it wraps.
| Return of 'info instr option| Sequence of 'info instr list| Select of 'info instr * 'info instr * 'info instr| If_annotation of {cond : Wax_wasm.Ast.cond;then_body : ('info instr list, location) annotated;else_body : ('info instr list, location) annotated option;}and 'info trycatch_arm = {arm_tag : ident option;None for the trailing catch-all
arm_ref : bool;& arm: the &exn is delivered above the payload
arm_types : valtype array;the arm's entry stack — the tag's payload, plus the &exn for a & arm: [||] as parsed, filled by the typer for To_wasm's re-lowering
arm_body : ('info instr list, location) annotated;}type import_kind = | Import_func of {}| Import_global of {mut : bool;typ : valtype;}| Import_tag of {}| Import_memory of {address_type : [ `I32 | `I64 ];limits : (Wax_utils.Uint64.t * Wax_utils.Uint64.t option) option;page_size_log2 : int option;}| Import_table of {address_type : [ `I32 | `I64 ];reftype : reftype;limits : (Wax_utils.Uint64.t * Wax_utils.Uint64.t option) option;}type data_elem = | Data_string of string| Data_run of storagetype * (string, location) annotated list| Data_v128 of (Wax_utils.V128.t, location) annotated listtype 'info modulefield = | Type of rectype| Func of {name : ident;typ : ident option;sign : functype option;body : label option * 'info instr list;attributes : attributes;}| Global of {name : ident;mut : bool;typ : valtype option;def : 'info instr;attributes : attributes;}| Tag of {name : ident;typ : ident option;sign : functype option;attributes : attributes;}| Memory of {name : ident;address_type : [ `I32 | `I64 ];limits : (Wax_utils.Uint64.t * Wax_utils.Uint64.t option) option;page_size_log2 : int option;data : 'info memdata list;attributes : attributes;}| Data of {name : ident option;mode : 'info datamode;init : data_elem list;attributes : attributes;}| Table of {name : ident;address_type : [ `I32 | `I64 ];reftype : reftype;limits : (Wax_utils.Uint64.t * Wax_utils.Uint64.t option) option;init : 'info instr option;attributes : attributes;}| Elem of {name : ident;reftype : reftype;mode : 'info elemmode;init : 'info instr list;attributes : attributes;}| Import of {module_ : (string, location) annotated;decl : (import_decl, location) annotated;}| Import_group of {module_ : (string, location) annotated;decls : (import_decl, location) annotated list;}| Module_annotation of attributes| Conditional of {cond : Wax_wasm.Ast.cond;then_fields : (('info modulefield, location) annotated list, location)
annotated;else_fields : (('info modulefield, location) annotated list, location)
annotated
option;}