Methods

Class/Module Index [+]

Quicksearch

YARD::Parser::C::CommentParser

Protected Instance Methods

parse_comments(comments) click to toggle source
# File lib/yard/parser/c/comment_parser.rb, line 7
def parse_comments(comments)
  @overrides = []
  spaces = nil
  comments = remove_private_comments(comments)
  comments = comments.split(/\r?\n/).map do |line|
    line.gsub!(%{^\s*/?\*/?}, '')
    line.gsub!(%{\*/\s*$}, '')
    if line =~ /^\s*$/
      next if spaces.nil?
      next ""
    end
    spaces = (line[/^(\s+)/, 1] || "").size if spaces.nil?
    line.gsub(/^\s{0,#{spaces}}/, '').rstrip
  end.compact

  comments = parse_overrides(comments)
  comments = parse_callseq(comments)
  comments.join("\n")
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.