In Files

  • rdoc/parsers/parse_rb.rb

Parent

Methods

Included Modules

Files

Class/Module Index [+]

Quicksearch

RDoc::RubyParser

Constants

NORMAL
SINGLE

Public Class Methods

new(top_level, file_name, content, options, stats) click to toggle source
 
               # File rdoc/parsers/parse_rb.rb, line 1387
def initialize(top_level, file_name, content, options, stats)
  @options = options
  @stats   = stats
  @size = 0
  @token_listeners = nil
  @input_file_name = file_name
  @scanner = RubyLex.new(content)
  @scanner.exception_on_syntax_error = false
  @top_level = top_level
  @progress = $stderr unless options.quiet
end
            

Public Instance Methods

scan() click to toggle source
 
               # File rdoc/parsers/parse_rb.rb, line 1399
def scan
  @tokens = []
  @unget_read = []
  @read = []
  catch(:eof) do
    catch(:enddoc) do
      begin
        parse_toplevel_statements(@top_level)
      rescue Exception => e
        $stderr.puts "\n\n"
        $stderr.puts "RDoc failure in #@input_file_name at or around " +
                     "line #{@scanner.line_no} column #{@scanner.char_no}"
        $stderr.puts 
        $stderr.puts "Before reporting this, could you check that the file"
        $stderr.puts "you're documenting compiles cleanly--RDoc is not a"
        $stderr.puts "full Ruby parser, and gets confused easily if fed"
        $stderr.puts "invalid programs."
        $stderr.puts
        $stderr.puts "The internal error was:\n\n"
        
        e.set_backtrace(e.backtrace[0,4])
        raise
      end
    end
  end
  @top_level
end
            

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.

blog comments powered by Disqus