package wax-lib

  1. Overview
  2. Docs
Libraries for Wax, a Rust-like syntax for WebAssembly

Install

dune-project
 Dependency

Authors

Maintainers

Sources

wax-0.1.0.tbz
sha256=41b580846af8d41bdf6c3f005f62e38feda3e60fe2e9e4aa440db34ce515a153
sha512=4b3a181fcc7d743194a8647260870fb5190770066a197bcc48104c2b77fd40c643228b795c2bcd6b29a120820e969eb42a37a9bcec98b3f608d13f152d9f6579

doc/wax-lib.utils/Wax_utils/Feature/index.html

Module Wax_utils.FeatureSource

Optional language features / WebAssembly proposals.

A feature is enabled or disabled (per its default, overridden on the command line). Validation queries is_enabled / require to accept or reject a construct, and mark_used / used track which features a module actually exercises.

Sourcetype t =
  1. | Custom_descriptors
  2. | Compact_import_section
Sourceval all : t list

Every known feature.

Sourceval name : t -> string

The command-line / diagnostic name, e.g. "custom-descriptors".

Sourceval description : t -> string
Sourceval enabled_by_default : t -> bool

Whether the feature is on when it is not mentioned on the command line.

Sourceval of_name : string -> t option
Sourcetype set

A resolved configuration: which features are enabled, together with a mutable record of which have been used. Create one per module (usage is per-module).

Sourceval configure : (t * bool) list -> set

configure specs takes each feature's default and applies specs over it (later entries win).

Sourceval set_config : (t * bool) list -> unit

Install a process-wide default configuration (like the warning policy), read by default. Intended to be called once, from the command line.

Sourceval default : unit -> set

A fresh set using the configuration installed by set_config (the built-in defaults if none), nothing used yet.

Sourceval is_enabled : set -> t -> bool

Whether t is enabled. Does not record usage.

Sourceval explicitly_disabled : set -> t -> bool

Whether the configuration set was built from explicitly disables t (an -X name=off spec), as opposed to t merely being off by default. A module declaring t against such a configuration is a conflict.

Sourceval declare : set -> t -> unit

Enable t in set: the module declares (with a #![feature = "…"] attribute or (@feature "…") annotation) that it uses t. Check explicitly_disabled first to report a conflict with the command line.

Sourceval mark_used : set -> t -> unit

Record that t is used (whether or not it is enabled). Idempotent.

Sourceval used : set -> t list

The features recorded by mark_used, in all order.

Sourceval parse_spec : string -> (t * bool, string) result

Parse a command-line spec: "NAME" or "NAME=on" enables the feature, "NAME=off" disables it.