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

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

Overview

Legacy Ruby parser

Since:

  • 0.5.6

Instance Method Summary collapse

Constructor Details

#initialize(source, filename) ⇒ RubyParser

Returns a new instance of RubyParser.

Since:

  • 0.5.6



8
9
10
# File 'lib/yard/parser/ruby/legacy/ruby_parser.rb', line 8

def initialize(source, filename)
  @source = source
end

Instance Method Details

#encoding_lineObject

Since:

  • 0.5.6



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

def encoding_line; @parse.encoding_line end

#enumeratorObject

Since:

  • 0.5.6



21
22
23
# File 'lib/yard/parser/ruby/legacy/ruby_parser.rb', line 21

def enumerator
  @parse
end

#parseObject

Since:

  • 0.5.6



12
13
14
15
# File 'lib/yard/parser/ruby/legacy/ruby_parser.rb', line 12

def parse
  @parse ||= StatementList.new(@source)
  self
end

#shebang_lineObject

Since:

  • 0.5.6



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

def shebang_line; @parse.shebang_line end

#tokenizeObject

Since:

  • 0.5.6



17
18
19
# File 'lib/yard/parser/ruby/legacy/ruby_parser.rb', line 17

def tokenize
  @tokenize ||= TokenList.new(@source)
end