Method: RDoc::Parser::Ruby#parse_require

Defined in:
lib/rdoc/parser/ruby.rb

#parse_require(context, comment) ⇒ Object

Parses an RDoc::Require in context containing comment



1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
# File 'lib/rdoc/parser/ruby.rb', line 1686

def parse_require(context, comment)
  skip_tkspace_comment
  tk = get_tk

  if :on_lparen == tk[:kind] then
    skip_tkspace_comment
    tk = get_tk
  end

  name = tk[:text][1..-2] if :on_tstring == tk[:kind]

  if name then
    @top_level.add_require RDoc::Require.new(name, comment)
  else
    unget_tk tk
  end
end