Skip to main content

Module surface

Module surface 

Source
Expand description

The surface AST the four frontends produce and the checker consumes.

Its JSON form is the JavaScript runtime’s ({ "k": "binary", "op": "add", … }), so the frontends of both runtimes can be compared node for node.

Structs§

ConstructorPrototypeDefinition
A source prototype definition, preserved until the checker refuses it.
ExternalParam
A parameter of another item’s function.
Guard
The leading if (n < 0n) throw … of a JavaScript parameter: a negative argument aborts with its message, the guards in their order.
SArrayItem
An element of an array literal, or with spread the elements of an array.
SBinder
SCase
One case of a single-level match.
SComparison
SCtor
SData
SExpr
A surface expression.
SField
SFn
SImport
A named import of items of another module of the crate, import { a, b as c } from './m.mjs'.
SImportName
An imported item: its name in its module and the name the import binds.
SMain
SModule
SParam
SPattern
A surface pattern.
SProgram
A parsed source program.
SProof
SProp
A surface proposition.
SRecordEntry
SRow
One row of a multi-scrutinee surface match.
SRule
SSplit
SSplitCase
STagTest
A JavaScript x.$ === 'tag' (or !==) test: the tested value, the tag and the data type that has it.
STheorem
SurfaceBindingTypeAnnotation
A present binding annotation, containing either null or an actual type.
SurfaceRawMetadata
One present raw Boolean or null; the containing Option records absence.

Enums§

BinaryOp
Surface binary operators: plus is JavaScript’s overloaded +.
External
Another item of the module, which a program calls or reads by name without declaring it.
Flavor
Conversion semantics: exact, checked (aborts when out of range) or clamped.
Rounding
Division rounding a source operator asks for.
SCasePattern
Patterns of a single-level match: one constructor, fields bound to names.
SEffect
SItem
SNode
SPatternNode
SPropNode
SStep
A proof step: t names the tactic family.
ShowStyle
How a value is printed: each source language’s own rendering.
UnaryOp