Skip to main content

Module ast

Module ast 

Source

ModulesΒ§

class_item πŸ”’
expr πŸ”’
function πŸ”’
member πŸ”’
types πŸ”’
use_item πŸ”’
util πŸ”’

StructsΒ§

AstAggregate
Some kind of aggregate, like a class, struct, etc.
AstBlock
AstConstructorField
AstExpr
AstFieldDecl
AstFunction
fn foo() { }
AstFunctionEffects
AstGenericDecl
type T? (: bounds)? perm T? (: bounds)?
AstLetStatement
let x = v, let x: t = v, etc
AstMainFunction
print("Hello world") appearing at the top of a module. This creates an implicit fn main() { ... } later on.
AstModule
AstParenExpr
AstPath
A β€œpath” identifies an item and a partial set of substitutions.
AstPerm
AstSelfArg
AstTy
AstUse
use $crate.$path [as $id]
AstVisibility
AstWhereClause
A where-clause looks like A is shared, A is lent, A is shared + lent, etc.
AstWhereClauses
Looks like where WC1, ... WC2,
DeferredParse
For functions, classes, and other items we often defer parsing their contents. This struct captures the contents and the span at which they appeared. It can then be used to parse the contents later. We also use it to parse an expression like a[...], as the ... may wind up being parsed as a generic term or an expression.
Identifier
IfArm
Literal
SpanVec
SpannedBinaryOp
SpannedIdentifier
SpannedUnaryOp
SquareBracketArgs
Created when we parse x[..] expressions or paths to store the .. contents. We can’t eagerly parse it because we don’t yet know whether to parse it as types or expressions.
VariableDecl
[mut] x: T

EnumsΒ§

AstAggregateKind
AstBinaryOp
AstExprKind
AstFunctionInput
AstGenericKind
AstGenericTerm
AstItem
AstMember
AstPathKind
AstPermKind
AstStatement
AstTyKind
AstWhereClauseKind
LiteralKind
PermissionOp
UnaryOp
VisibilityKind