class SyntaxTree::Next
Next
represents using the next
keyword.
next
The next
keyword can also optionally be called with an argument:
next value
next
can even be called with multiple arguments, but only if parentheses are omitted, as in:
next first, second, third
If a single value is being given, parentheses can be used, as in:
next(value)
Attributes
Args
-
the arguments passed to the next keyword
Public Class Methods
Source
# File lib/syntax_tree/node.rb, line 7955 def initialize(arguments:, location:) @arguments = arguments @location = location @comments = [] end
Public Instance Methods
Source
# File lib/syntax_tree/node.rb, line 7990 def ===(other) other.is_a?(Next) && arguments === other.arguments end
Source
# File lib/syntax_tree/node.rb, line 7961 def accept(visitor) visitor.visit_next(self) end
Source
# File lib/syntax_tree/node.rb, line 7965 def child_nodes [arguments] end
Also aliased as: deconstruct
Source
# File lib/syntax_tree/node.rb, line 7969 def copy(arguments: nil, location: nil) node = Next.new( arguments: arguments || self.arguments, location: location || self.location ) node.comments.concat(comments.map(&:copy)) node end
Source
# File lib/syntax_tree/node.rb, line 7982 def deconstruct_keys(_keys) { arguments: arguments, location: location, comments: comments } end
Source
# File lib/syntax_tree/node.rb, line 7986 def format(q) FlowControlFormatter.new("next", self).format(q) end