Class: YARD::Parser::Ruby::RipperParser
- Inherits:
-
Ripper
- Object
- Ripper
- YARD::Parser::Ruby::RipperParser
- Defined in:
- lib/yard/parser/ruby/ruby_parser.rb
Overview
Internal parser class
Instance Attribute Summary collapse
- #ast ⇒ Object (also: #root) readonly
- #charno ⇒ Object readonly
- #comments ⇒ Object readonly
- #file ⇒ Object readonly
- #tokens ⇒ Object readonly
Instance Method Summary collapse
- #enumerator ⇒ Object
-
#initialize(source, filename, *args) ⇒ RipperParser
constructor
A new instance of RipperParser.
- #parse ⇒ Object
Constructor Details
#initialize(source, filename, *args) ⇒ RipperParser
Returns a new instance of RipperParser.
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/yard/parser/ruby/ruby_parser.rb', line 23 def initialize(source, filename, *args) super @last_ns_token = nil @file = filename @source = source @tokens = [] @comments = {} @map = {} @ns_charno = 0 @list = [] @charno = 0 @groups = [] end |
Instance Attribute Details
#ast ⇒ Object (readonly) Also known as: root
20 21 22 |
# File 'lib/yard/parser/ruby/ruby_parser.rb', line 20 def ast @ast end |
#charno ⇒ Object (readonly)
20 21 22 |
# File 'lib/yard/parser/ruby/ruby_parser.rb', line 20 def charno @charno end |
#comments ⇒ Object (readonly)
20 21 22 |
# File 'lib/yard/parser/ruby/ruby_parser.rb', line 20 def comments @comments end |
#file ⇒ Object (readonly)
20 21 22 |
# File 'lib/yard/parser/ruby/ruby_parser.rb', line 20 def file @file end |
#tokens ⇒ Object (readonly)
20 21 22 |
# File 'lib/yard/parser/ruby/ruby_parser.rb', line 20 def tokens @tokens end |
Instance Method Details
#enumerator ⇒ Object
46 47 48 |
# File 'lib/yard/parser/ruby/ruby_parser.rb', line 46 def enumerator ast.children end |
#parse ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'lib/yard/parser/ruby/ruby_parser.rb', line 37 def parse @ast = super @ast.full_source = @source @ast.file = @file freeze_tree insert_comments self end |