Struct passerine::compiler::hoist::Hoister[][src]

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

Keeps track of:

  1. Local and nonlocal variables in each scope.
  2. All variables declared.
  3. Variables that have been used but not declared.

Implementations

Creates a new hoisted in a root scope. Note that the hoister will always have a root scope.

Walks a CST to produce an SST. This is fairly standard - hoisting happens in self.assign, self.lambda, and self.symbol.

Walks a pattern. If declare is true, we shadow variables in existing scopes and creates a new variable in the local scope.

Replaces a symbol name with a unique identifier for that symbol

Walks a block, nothing fancy here.

Walks a tuple, nothing fancy here.

Walks an assignment. Delegates to walk_pattern for capturing. Assignments can capture existing variables

Walks a function definition. Like assign, delegates to walk_pattern for capturing. But any paramaters will shadow those in outer scopes.

Walks a function call.

Trait Implementations

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.