Skip to main content

Crate wolf_ast

Crate wolf_ast 

Source
Expand description

The syntax tree of wolfpack (spec chapters 2 and 3).

The tree mirrors the source closely: it keeps sections in written order, doc comments and spans, and it may contain ExprKind::Error and similar nodes where the parser recovered from an error. Meaning is assigned by later phases; for example a.b.c is a chain of field accesses here, whether a turns out to be a module, a type or a variable.

Structs§

AliasDecl
type Name<T> = Type
Arg
An argument of a call.
Arm
An arm of a match.
Block
A block of statements.
ClosureParam
A closure parameter.
ConfigEntry
name: Type = value in config.
Doc
A doc comment.
EnumDecl
enum Name<T> { variants }
Expr
An expression.
ExternDecl
A declaration inside an extern target block.
ExternTarget
A target block inside extern.
Field
A field of a struct or of a variant.
FieldInit
A field in a struct literal.
FieldPat
A field in a struct pattern.
File
A whole source file.
FnDecl
A function or method declaration.
FnSig
Name, type parameters, parameters and result.
GenericParam
A type parameter with its bounds: T: Comparable + Copyable.
Ident
A name with its position.
ImplBlock
A block in impl: Stack<T: Comparable>: Container<T> { methods }.
Import
An import (spec chapter 6, section 2).
ImportName
One name in an import group.
InterfaceDecl
interface Name<T> { signatures }
IntrinsicTypeDecl
intrinsic type Name<T>
Item
A declaration inside a section.
Method
A method inside an impl block.
MethodSig
A signature inside an interface.
NodeId
Identifies an expression, pattern or type node, for side tables in later phases.
Param
A parameter.
Pat
A pattern in a match arm.
Path
A dotted name such as users.model or StorageError.Full.
Section
A section and its entries.
Stmt
A statement.
StrLit
A string literal with its position.
StructDecl
struct Name<T> { fields }
TestDecl
test "name" { body }
Ty
A written type.
Variant
A variant of an enum.

Enums§

AssignOp
Assignment operators.
BinaryOp
Binary operators.
ExprKind
The forms of expressions.
ExternDeclKind
What an extern declaration declares.
ForIter
What a for loop walks over.
ItemKind
The kinds of declarations.
Mode
How a value is passed (spec chapter 5, section 5).
ParamKind
The two kinds of parameters.
PatKind
The forms of patterns (spec chapter 3, section 7).
SectionKind
The nine parts of a file, in their required order (spec chapter 2, section 2).
StmtKind
The forms of statements.
TyKind
The forms of a written type.
UnaryOp
Unary operators.
VariantPayload
The data a variant carries.

Functions§

dump
Renders a file as an indented tree without spans.