package wax-lib
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=4361e1324b7754a4c08ab5b505df32061f3ce0cea60443fd0d3699e0fa796b32
sha512=fcc756d2f160ba90a9aa1131f2ab22ed7f45466ccd658c21cf9df6868a6aab0cee7f404719d698a379958802f9820398f2fe0685ecc4dda018ca4f653294e39b
doc/wax-lib.wax/Wax_lang/Members/index.html
Module Wax_lang.MembersSource
Member-completion candidates and value-method tables for recv.<here> and ns::<here>: the fields, value methods and namespace free functions the editor offers there, with their rendered types and signatures. Shared between the type checker (which records a member_receiver at each access and dispatches through the same registries) and Wax_editor.
type member_candidate = {member_name : string;member_kind : member_kind;member_detail : string;
}A candidate for member completion at recv.<here> or ns::<here>: a struct field, a value method, or a namespace free function, with the member_kind driving the editor's icon and member_detail a rendered type/signature — the field's declared type (i32, mut i32, &point) or the method/function's signature (fn() -> i32). Collected by Typing.f_infer via member_completions, or produced by namespace_members.
type value_method = {vm_name : string;vm_binary : bool;(*takes a second operand of the receiver's type
*)vm_result : method_result;
}The value methods member completion offers for an integer / float receiver (e.g. x.sqrt()). A curated registry, since the method dispatch is match-based and not enumerable; the test in test/method-consistency type-checks each — arity and result type included — to keep it in step with the typer.
The value type a SIMD intrinsic operand / result stands for, as a fresh resolved value type.
The value methods member completion offers for a v128 receiver — the vector ops v.add_i32x4(w), with their signatures. Enumerated from the SIMD registry (Wax_wasm.Simd.method_names), which is also what the typer dispatches through, so the list cannot drift from what type-checks.
The value-method candidates member completion offers for a numeric receiver of the given inferred type — a concrete numeric valtype (i32 … v128) or a still-flexible literal (number/int/large number/float, which take their integer and/or float methods by family). None when the type has no value methods (a packed i8/i16, which must be cast first, or a non-numeric type).
The methods member completion offers on a memory receiver (mem.load8(addr)) — the scalar loads/stores, size/grow/fill/copy/init, and the atomic and SIMD memory accesses — with addr_name the memory's address type (i32/i64) for their signatures.
The methods member completion offers on a table receiver (tab.size()) — size/grow/fill/copy/init — with addr_name the table's address type and elem_name its element type for their signatures.
The methods member completion offers on an array receiver (a.length()) of the given element type — length and the fill/copy/init bulk operations.
The free functions completion offers after an intrinsic namespace path ns::: v128:: (SIMD const constructors and bitselect), i64:: (wide-arithmetic ops) and atomic:: (fence), each with its signature. Empty for any other ns — a declared continuation type's new/bind members need the module's declarations (the editor resolves them from the buffer's AST).
val cont_method_candidates :
params:string list ->
results:string list ->
switch_results:string list ->
member_candidate listThe methods member completion offers on a continuation-typed receiver — the resume family and switch — from the rendered parameter/result types of the continuation's function type (switch_results the last parameter's own continuation parameters, when it has one). Recorded prebuilt as R_cont; also used by the editor's signature help, which renders the types from the buffer's declarations.
type member_receiver = | R_numeric of Infer.inferred_type| R_struct of Ast.fieldtype Ast.annotated_array| R_array of Ast.fieldtype| R_memory of [ `I32 | `I64 ]| R_table of [ `I32 | `I64 ] * Ast.reftype| R_cont of member_candidate list(*What a member access
*)recv.<here>is on, recorded byTyping.f_infer(viamember_completions) so completion can derive its candidates withmember_candidatesonly for the access under the cursor — the list, large for a v128 / memory receiver, is not built at every access in the file.
Whether a value receiver of the given type has value methods, as the lightweight R_numeric descriptor the recorder classifies with before building any candidate list. Its domain matches numeric_receiver_candidates returning Some.
The member-completion candidates a recorded member_receiver stands for.
The intrinsic namespace names (v128/i64/atomic) — the ns a :: path can start with — for completion of the namespace itself.