Package org.jruby.ast
Class BlockNode
java.lang.Object
org.jruby.ast.Node
org.jruby.ast.ListNode
org.jruby.ast.BlockNode
Represents a block of nodes (read that as list).
-
Field Summary
Fields inherited from class org.jruby.ast.Node
containsVariableAssignment, newline
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> T
accept
(NodeVisitor<T> iVisitor) RubyMethod used by visitors.boolean
Methods inherited from class org.jruby.ast.ListNode
add, addAll, addAll, addAll, addAllInternal, addInternal, childNodes, children, get, getLast, isEmpty, iterator, size
Methods inherited from class org.jruby.ast.Node
containsVariableAssignment, createList, createList, createList, createList, getFile, getLine, getNodeName, isNewline, isNil, needsDefinitionCheck, setLine, setNewline, toString, toString, toStringExtraInfo, toStringInternal, unsetNewline
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
BlockNode
public BlockNode(int line)
-
-
Method Details
-
getNodeType
- Overrides:
getNodeType
in classListNode
- Returns:
- the nodeId
-
accept
RubyMethod used by visitors. accepts the visitor -
executesOnce
public boolean executesOnce()- Overrides:
executesOnce
in classNode
- Returns:
- is it possible this node will execute only once. Note: This is not comprehensive. It is used to look from root node down to class/module nodes to make sure that narrow case can execute once. It is possible much deeper down the tree some nodes can only execute once but it will be marked as false because that case is not what this is for.
-