Package org.jruby.ast

Class BlockNode

All Implemented Interfaces:
Iterable<Node>

public class BlockNode extends ListNode
Represents a block of nodes (read that as list).
  • Constructor Details

    • BlockNode

      public BlockNode(int line)
  • Method Details

    • getNodeType

      public NodeType getNodeType()
      Overrides:
      getNodeType in class ListNode
      Returns:
      the nodeId
    • accept

      public <T> T accept(NodeVisitor<T> iVisitor)
      RubyMethod used by visitors. accepts the visitor
      Overrides:
      accept in class ListNode
      Parameters:
      iVisitor - the visitor to accept
    • executesOnce

      public boolean executesOnce()
      Overrides:
      executesOnce in class Node
      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.