Struct koto_parser::Ast[][src]

pub struct Ast { /* fields omitted */ }
Expand description

A Koto program represented as an Abstract Syntax Tree

This is produced by the parser, and consumed by the compiler.

Implementations

Initializes an Ast with the given capacity

Pushes a node and corresponding span onto the tree

Pushes a node onto the tree, associating it with an existing span

Returns a node for a given node index

Returns a span for a given span index

Returns the constant pool referred to by the AST

Moves the constants out of the AST

This is used when building a Chunk after compilation. The constants get transferred to the Chunk once the AST has been converted into bytecode.

Returns the root node in the tree

Used in testing to validate the tree’s contents

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.