# File lib/puppet/util/rdoc/parser.rb, line 404
404:   def parse_puppet_plugin(container)
405:     comments = ""
406:     current_plugin = nil
407: 
408:     File.open(@input_file_name) do |of|
409:       of.each do |line|
410:         # fetch comments
411:         if line =~ /^[ \t]*# ?(.*)$/
412:           comments += $1 + "\n"
413:         elsif line =~ /^[ \t]*newfunction[ \t]*\([ \t]*:(.*?)[ \t]*,[ \t]*:type[ \t]*=>[ \t]*(:rvalue|:lvalue)\)/
414:           current_plugin = Plugin.new($1, "function")
415:           container.add_plugin(current_plugin)
416:           look_for_directives_in(container, comments) unless comments.empty?
417:           current_plugin.comment = comments
418:           current_plugin.record_location(@top_level)
419:           comments = ""
420:           Puppet.debug "rdoc: found new function plugins #{current_plugin.name}"
421:         elsif line =~ /^[ \t]*Puppet::Type.newtype[ \t]*\([ \t]*:(.*?)\)/
422:           current_plugin = Plugin.new($1, "type")
423:           container.add_plugin(current_plugin)
424:           look_for_directives_in(container, comments) unless comments.empty?
425:           current_plugin.comment = comments
426:           current_plugin.record_location(@top_level)
427:           comments = ""
428:           Puppet.debug "rdoc: found new type plugins #{current_plugin.name}"
429:         elsif line =~ /module Puppet::Parser::Functions/
430:           # skip
431:         else # unknown line type
432:           comments =""
433:         end
434:       end
435:     end
436:   end