Rescue
represents the use of the rescue keyword inside of a BodyStmt
node.
begin rescue endAttributes
Rescue
the optional next clause in the chain
RescueEx
the exceptions being rescued
Statements
the expressions to evaluate when an error is rescued
def initialize(keyword:, exception:, statements:, consequent:, location:) @keyword = keyword @exception = exception @statements = statements @consequent = consequent @location = location @comments = [] endPublic Instance Methods Source
def ===(other) other.is_a?(Rescue) && keyword === other.keyword && exception === other.exception && statements === other.statements && consequent === other.consequent endSource
def accept(visitor) visitor.visit_rescue(self) endSource
def bind_end(end_char, end_column) @location = Location.new( start_line: location.start_line, start_char: location.start_char, start_column: location.start_column, end_line: location.end_line, end_char: end_char, end_column: end_column ) if (next_node = consequent) next_node.bind_end(end_char, end_column) statements.bind_end( next_node.location.start_char, next_node.location.start_column ) else statements.bind_end(end_char, end_column) end endSource
def child_nodes [keyword, exception, statements, consequent] endSource
def copy( keyword: nil, exception: nil, statements: nil, consequent: nil, location: nil ) node = Rescue.new( keyword: keyword || self.keyword, exception: exception || self.exception, statements: statements || self.statements, consequent: consequent || self.consequent, location: location || self.location ) node.comments.concat(comments.map(&:copy)) node endSource
def deconstruct_keys(_keys) { keyword: keyword, exception: exception, statements: statements, consequent: consequent, location: location, comments: comments } endSource
def format(q) q.group do q.format(keyword) if exception q.nest(keyword.value.length + 1) { q.format(exception) } else q.text(" StandardError") end unless statements.empty? q.indent do q.breakable_force q.format(statements) end end if consequent q.breakable_force q.format(consequent) end end end
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4