class Ameba::AST::Branchable
- Ameba::AST::Branchable
- Reference
- Object
Overview
A generic entity to represent a branchable Crystal node.
For example, Crystal::If
, Crystal::Unless
, Crystal::While
are branchables.
white a > 100 # Branchable A
if b > 2 # Branchable B
a += 1
end
end
Included Modules
Defined in:
ameba/ast/branchable.crConstructors
-
.new(node, parent = nil)
Creates a new branchable
Instance Method Summary
- #branches : Array(Crystal::ASTNode)
- #end_location(*args, **options)
- #end_location(*args, **options, &)
- #location(*args, **options)
- #location(*args, **options, &)
-
#loop?
Returns true if this node or one of the parent branchables is a loop, false otherwise.
-
#node : Crystal::ASTNode
The actual Crystal node.
-
#parent : Branchable?
Parent branchable (if any)
- #to_s(*args, **options)
- #to_s(*args, **options, &)