class SyntaxTree::Parser
def on_ensure(statements)
:call-seq:
def on_ensure(statements) keyword = consume_keyword(:ensure) # We don't want to consume the :@kw event, because that would break # def..ensure..end chains. ending = find_keyword(:end) start_char = find_next_statement_start(keyword.location.end_char) statements.bind( self, start_char, start_char - line_counts[keyword.location.start_line - 1].start, ending.location.start_char, ending.location.start_column ) Ensure.new( keyword: keyword, statements: statements, location: keyword.location.to(ending.location) ) end