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§
- Alias
Decl type Name<T> = Type- Arg
- An argument of a call.
- Arm
- An arm of a
match. - Block
- A block of statements.
- Closure
Param - A closure parameter.
- Config
Entry name: Type = valueinconfig.- Doc
- A doc comment.
- Enum
Decl enum Name<T> { variants }- Expr
- An expression.
- Extern
Decl - A declaration inside an extern target block.
- Extern
Target - A target block inside
extern. - Field
- A field of a struct or of a variant.
- Field
Init - A field in a struct literal.
- Field
Pat - A field in a struct pattern.
- File
- A whole source file.
- FnDecl
- A function or method declaration.
- FnSig
- Name, type parameters, parameters and result.
- Generic
Param - A type parameter with its bounds:
T: Comparable + Copyable. - Ident
- A name with its position.
- Impl
Block - A block in
impl:Stack<T: Comparable>: Container<T> { methods }. - Import
- An import (spec chapter 6, section 2).
- Import
Name - One name in an import group.
- Interface
Decl interface Name<T> { signatures }- Intrinsic
Type Decl intrinsic type Name<T>- Item
- A declaration inside a section.
- Method
- A method inside an impl block.
- Method
Sig - A signature inside an interface.
- Native
Sig - The Rust types of a function of a native module, which the generated call must match.
- NodeId
- Identifies an expression, pattern or type node, for side tables in later phases.
- Param
- A parameter.
- Pat
- A pattern in a
matcharm. - Path
- A dotted name such as
users.modelorStorageError.Full. - Section
- A section and its entries.
- Stmt
- A statement.
- StrLit
- A string literal with its position.
- Struct
Decl struct Name<T> { fields }- Test
Decl test "name" { body }- Ty
- A written type.
- Variant
- A variant of an enum.
Enums§
- Assign
Op - Assignment operators.
- Binary
Op - Binary operators.
- Expr
Kind - The forms of expressions.
- Extern
Decl Kind - What an extern declaration declares.
- FStr
Part - A part of an interpolated string.
- ForIter
- What a
forloop walks over. - Item
Kind - The kinds of declarations.
- Mode
- How a value is passed (spec chapter 5, section 5).
- Native
Ty - A Rust type of a native function, in the forms of spec chapter 7, section 8.7, rule 3.
- Param
Kind - The two kinds of parameters.
- PatKind
- The forms of patterns (spec chapter 3, section 7).
- Section
Kind - The nine parts of a file, in their required order (spec chapter 2, section 2).
- Stmt
Kind - The forms of statements.
- TyKind
- The forms of a written type.
- UnaryOp
- Unary operators.
- Variant
Payload - The data a variant carries.
Functions§
- dump
- Renders a file as an indented tree without spans.