class SyntaxTree::Parser
def on_unless(predicate, statements, consequent)
((nil | Elsif | Else) consequent)
Statements statements,
untyped predicate,
on_unless: (
:call-seq:
def on_unless(predicate, statements, consequent) beginning = consume_keyword(:unless) ending = consequent || consume_keyword(:end) if (keyword = find_keyword_between(:then, predicate, ending)) tokens.delete(keyword) end start_char = find_next_statement_start((keyword || predicate).location.end_char) statements.bind( self, start_char, start_char - line_counts[predicate.location.end_line - 1].start, ending.location.start_char, ending.location.start_column ) UnlessNode.new( predicate: predicate, statements: statements, consequent: consequent, location: beginning.location.to(ending.location) ) end