class YARD::Parser::Ruby::Legacy::StatementList

def process_simple_block_opener(tk)

Parameters:
  • tk (RubyToken::Token) -- the token to process
def process_simple_block_opener(tk)
  return unless [TkLBRACE, TkDO, TkBEGIN, TkELSE].include?(tk.class) &&
                # Make sure hashes are parsed as hashes, not as blocks
                (@last_ns_tk.nil? || @last_ns_tk.lex_state != EXPR_BEG)
  @level += 1
  @state = :block
  @block_num += 1
  if @block.nil?
    @block = TokenList.new
    tokens = [tk, TkStatementEnd.new(tk.line_no, tk.char_no)]
    tokens = tokens.reverse if TkBEGIN === tk.class
    @statement.concat(tokens)
  else
    @statement << tk
  end
  true
end