class SyntaxTree::Parser

def on_case(value, consequent)

on_case: (untyped value, untyped consequent) -> Case | RAssign
:call-seq:
def on_case(value, consequent)
  if value && (operator = find_keyword(:in) || find_operator(:"=>")) &&
       (value.location.end_char...consequent.location.start_char).cover?(
         operator.location.start_char
       )
    tokens.delete(operator)
    node =
      RAssign.new(
        value: value,
        operator: operator,
        pattern: consequent,
        location: value.location.to(consequent.location)
      )
    PinVisitor.visit(node, tokens)
    node
  else
    keyword = consume_keyword(:case)
    Case.new(
      keyword: keyword,
      value: value,
      consequent: consequent,
      location: keyword.location.to(consequent.location)
    )
  end
end