class SyntaxTree::Parser

def on_class(constant, superclass, bodystmt)

) -> ClassDeclaration
BodyStmt bodystmt
untyped superclass,
(ConstPathRef | ConstRef | TopConstRef) constant,
on_class: (
:call-seq:
def on_class(constant, superclass, bodystmt)
  beginning = consume_keyword(:class)
  ending = consume_keyword(:end)
  location = (superclass || constant).location
  start_char = find_next_statement_start(location.end_char)
  bodystmt.bind(
    self,
    start_char,
    start_char - line_counts[location.start_line - 1].start,
    ending.location.start_char,
    ending.location.start_column
  )
  ClassDeclaration.new(
    constant: constant,
    superclass: superclass,
    bodystmt: bodystmt,
    location: beginning.location.to(ending.location)
  )
end