Module ast

Source
Description

AST types used by the macro system.

Declares the raw-token vocabulary, the structured pattern/expression/type-expression trees, and the record/union shapes consumed by derive-style macros.

Data Types

Records

FieldDef

Describes a single field of a record type definition: its declared name

ImplDef

A generated :impl block: the trait name, the type arguments applied to

ImplOpDef

One operation (method) inside a generated :impl block: method name,

MatchArm

One arm of a :match expression: a pattern plus the body expressions

RecordTypeDef

Describes a record type definition consumed by derive-style macros:

UnionTypeDef

Describes a union type definition consumed by derive-style macros:

VariantDef

Describes a single variant of a union type definition: its name and the

Unions

Expr

Structured expression tree produced by parse-expr.

Pattern

Structured match pattern produced by parse-pattern.

Token

Raw token produced by the lexer.

TopLevelAst

Top-level AST node produced by a derive-style macro.

TypeDef

A type definition suitable for a derive macro input — either a record

TypeExprAst

Parsed type expression.

Aliases

Block

Alias for a sequence of expressions forming a block body.

TokenSeq

Alias for a vector of tokens — the canonical type for token streams