Class: YARD::Parser::Ruby::RubyParser

Inherits:
Base
  • Object
show all
Defined in:
lib/yard/parser/ruby/ruby_parser.rb

Overview

Ruby 1.9 parser

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

parse

Constructor Details

#initialize(source, filename) ⇒ RubyParser

Returns a new instance of RubyParser.



11
12
13
# File 'lib/yard/parser/ruby/ruby_parser.rb', line 11

def initialize(source, filename)
  @parser = RipperParser.new(source, filename)
end

Instance Attribute Details

#encoding_lineObject (readonly)

Returns the current value of encoding_line.

Returns:

  • (Object)

    the current value of encoding_line



10
11
12
# File 'lib/yard/parser/ruby/ruby_parser.rb', line 10

def encoding_line
  @encoding_line
end

#enumeratorObject (readonly)

Returns the current value of enumerator.

Returns:

  • (Object)

    the current value of enumerator



10
11
12
# File 'lib/yard/parser/ruby/ruby_parser.rb', line 10

def enumerator
  @enumerator
end

#shebang_lineObject (readonly)

Returns the current value of shebang_line.

Returns:

  • (Object)

    the current value of shebang_line



10
11
12
# File 'lib/yard/parser/ruby/ruby_parser.rb', line 10

def shebang_line
  @shebang_line
end

Instance Method Details

#parseObject



15
# File 'lib/yard/parser/ruby/ruby_parser.rb', line 15

def parse; @parser.parse end

#tokenizeObject



16
# File 'lib/yard/parser/ruby/ruby_parser.rb', line 16

def tokenize; @parser.tokens end