Module ast

Module ast 

Source
Expand description

ASTs for type annotations and their parsing logic.

§Overview

This module contains types representing AST for parsed type annotations; for example, TypeAst and FunctionAst. These two types expose parse method which allows to integrate them into nom parsing.

Structs§

ConstraintsAst
Parameter constraints, e.g. for<len! N; T: Lin>.
FunctionAst
Parsed functional type.
ObjectAst
Object type or constraint, such as { x: Num, y: [(Num, Bool)] }.
SliceAst
Parsed slice type, such as [Num; N].
TupleAst
Parsed tuple type, such as (Num, Bool) or (fn() -> Num, ...[Num; _]).
TypeConstraintsAst
Bounds that can be placed on a type variable.

Enums§

AstConversionError
Kinds of errors that can occur when converting *Ast types into their “main” counterparts.
TupleLenAst
Parsed tuple length.
TypeAst
Type annotation after parsing.

Type Aliases§

SpannedTypeAst
Spanned TypeAst.