Skip to main content

Module ast

Module ast 

Source
Expand description

The Cove abstract syntax tree.

The tree mirrors the surface language described by docs/LANGUAGE_CARD.md. Where the Language Card and ADR 0001 disagree, the Language Card wins. What each form below means — how it is typed, how it evaluates, and which errors it can produce — is stated once in docs/LANGUAGE_REFERENCE.md.

Structs§

Arg
One argument at a call site.
Block
EnumCase
EnumDecl
Expr
ExprId
Identifies one expression within the file it was parsed from.
Field
FnDecl
GenericParam
One type parameter of a declaration, with the traits it is bounded by.
ImplBlock
impl Type { ... }, or impl Trait for Type { ... } when trait_name is present.
Item
A top-level declaration.
MatchArm
Param
Pattern
Receiver
The self parameter of a method.
SourceUnit
One .cove file. Every file in a directory is an implementation unit of the same module.
Stmt
StructDecl
TraitDecl
A trait: a set of method signatures a type conforms to explicitly.
TraitMethod
One method signature a trait declares, with an optional default body.
Type
A type expression.
TypeAlias
Use
use console.println or use http.

Enums§

BinaryOp
ExprKind
ItemKind
PatternKind
StmtKind
StrPart
A resolved piece of a string literal.
TypeKind
UnaryOp

Type Aliases§

Ident