class Savi::AST::Yield
- Savi::AST::Yield
- Savi::AST::Node
- Reference
- Object
Overview
A Yield node indicates a kind of "intermediate return" where a function returns some yielded values back to the "yield block" of the caller, after which the caller can "continue" the yielding function back at the same place of execution where it was at that particular Yield. The result value of a Yield is the result value that was at the end of the "yield block" on the caller side, so this construct can also be used to get values back from the caller as well.
This is an internal AST type which has no corresponding source code syntax, because such a construct is only created inside macro expansions.
However, the most obvious example of use is in the yield
macro.
Defined in:
savi/ast.crConstructors
Instance Method Summary
- #children_accept(ctx : Compiler::Context, visitor : Visitor)
- #children_accept(ctx : Compiler::Context, visitor : CopyOnMutateVisitor)
- #name
- #span_pos(source)
- #terms : Array(Term)
- #terms=(terms : Array(Term))
- #to_a : Array(A)
Instance methods inherited from class Savi::AST::Node
accept(ctx : Compiler::Context, visitor : Visitor)accept(ctx : Compiler::Context, visitor : CopyOnMutateVisitor) accept, annotations : Array(Annotation) | Nil annotations, annotations=(annotations : Array(Annotation) | Nil) annotations=, children_accept(ctx : Compiler::Context, visitor : Visitor)
children_accept(ctx : Compiler::Context, visitor : CopyOnMutateVisitor) children_accept, from(other : Node) from, pos pos, pos? : Savi::Source::Pos? pos?, span_pos(source) span_pos, with_pos(pos : Source::Pos) with_pos