# File lib/rabbit/parser/rd.rb, line 19 def match?(source) extension = source.extension if extension.nil? head = source.read[0, 500] if head.respond_to?(:force_encoding) head.force_encoding("ASCII-8BIT") end /^= /.match(head) else /\A(?:rd|rab|rbt)\z/ =~ extension end end
# File lib/rabbit/parser/rd.rb, line 33 def parse source = @source.read.gsub(/\r\n/, "\n") source = "=begin\n#{source}\n=end\n" tree = ::RD::RDTree.new(source) visitor = RD2RabbitVisitor.new(@canvas) visitor.visit(tree) rescue Racc::ParseError message = format_parse_error_message($!.message, source) raise ParseError.new, message, $@ end
Generated with the Darkfish Rdoc Generator 2.