Parent

Class/Module Index [+]

Quicksearch

YARD::Parser::Ruby::RipperParser

Internal parser class @since 0.5.6

Attributes

ast[R]
charno[R]
comments[R]
encoding_line[R]
file[R]
root[R]
shebang_line[R]
tokens[R]

Public Class Methods

new(source, filename, *args) click to toggle source
# File lib/yard/parser/ruby/ruby_parser.rb, line 29
def initialize(source, filename, *args)
  super
  @last_ns_token = nil
  @file = filename
  @source = source
  @tokens = []
  @comments = {}
  @comments_range = {}
  @comments_flags = {}
  @heredoc_tokens = nil
  @heredoc_state = nil
  @map = {}
  @ns_charno = 0
  @list = []
  @charno = 0
  @shebang_line = nil
  @encoding_line = nil
  @file_encoding = nil
end

Public Instance Methods

enumerator() click to toggle source
# File lib/yard/parser/ruby/ruby_parser.rb, line 58
def enumerator
  ast.children
end
file_encoding() click to toggle source
# File lib/yard/parser/ruby/ruby_parser.rb, line 62
def file_encoding
  return nil unless defined?(::Encoding)
  return @file_encoding if @file_encoding
  return Encoding.default_internal unless @encoding_line
  if match = @encoding_line.match(SourceParser::ENCODING_LINE)
    @file_encoding = match.captures.last
  end
end
parse() click to toggle source
# File lib/yard/parser/ruby/ruby_parser.rb, line 49
def parse
  @ast = super
  @ast.full_source = @source
  @ast.file = @file
  freeze_tree
  insert_comments
  self
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.