[][src]Module ra_ap_syntax::ast

Abstract Syntax Tree, layered on top of untyped SyntaxNodes

Modules

edit

This module contains functions for editing syntax trees. As the trees are immutable, all function here return a fresh copy of the tree, instead of doing an in-place modification.

make

This module contains free-standing functions for creating AST fragments out of smaller pieces.

Structs

Abi
ArgList
ArrayExpr
ArrayType
AssocItemList
AssocTypeArg
AstChildren

An iterator over SyntaxNode children of a particular AST type.

Attr
AwaitExpr
BinExpr
BlockExpr
BoxExpr
BoxPat
BreakExpr
CallExpr
CastExpr
ClosureExpr
Comment
CommentIter
CommentKind
Condition
Const
ConstArg
ConstParam
ContinueExpr
DynTraitType
EffectExpr
Enum
ExprStmt
ExternBlock
ExternCrate
ExternItemList
FieldExpr
Fn
FnPtrType
ForExpr
ForType
GenericArgList
GenericParamList
IdentPat
IfExpr
Impl
ImplTraitType
IndexExpr
InferType
ItemList
Label
LetStmt
LifetimeArg
LifetimeParam
Literal
LiteralPat
LoopExpr
MacroCall
MacroItems
MacroPat
MacroStmts
MatchArm
MatchArmList
MatchExpr
MatchGuard
MethodCallExpr
Module
Name
NameRef
NeverType
OrPat
Param
ParamList
ParenExpr
ParenPat
ParenType
Path
PathExpr
PathPat
PathSegment
PathType
PrefixExpr
PtrType
QuoteOffsets
RangeExpr
RangePat
RawString
RecordExpr
RecordExprField
RecordExprFieldList
RecordField
RecordFieldList
RecordPat
RecordPatField
RecordPatFieldList
RefExpr
RefPat
RefType
Rename
RestPat
RetType
ReturnExpr
SelfParam
SlicePat
SlicePatComponents
SliceType
SourceFile
Static
String
Struct
TokenTree
Trait
TryExpr
TupleExpr
TupleField
TupleFieldList
TuplePat
TupleStructPat
TupleType
TypeAlias
TypeArg
TypeBound
TypeBoundList
TypeParam
Union
Use
UseTree
UseTreeList
Variant
VariantList
Visibility
WhereClause
WherePred
WhileExpr
Whitespace
WildcardPat

Enums

AdtDef
ArrayExprKind
AssocItem
AttrKind
BinOp
CommentPlacement
CommentShape
Effect
ElseBranch
Expr
ExternItem
FieldKind
FieldList
FormatSpecifier
GenericArg
GenericParam
Item
LiteralKind
NameOrNameRef
Pat
PathSegmentKind
PrefixOp
RangeOp
SelfParamKind
Stmt
StructKind
Type
TypeBoundKind
VisibilityKind

Traits

ArgListOwner
AstNode

The main trait to go from untyped SyntaxNode to a typed ast. The conversion itself has zero runtime cost: ast and syntax nodes have exactly the same representation: a pointer to the tree root and a pointer to the node itself.

AstToken

Like AstNode, but wraps tokens rather than interior nodes.

AttrsOwner
DocCommentsOwner
GenericParamsOwner
HasFormatSpecifier
HasQuotes
HasStringValue
LoopBodyOwner
ModuleItemOwner
NameOwner
TypeBoundsOwner
VisibilityOwner