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
Constant Summary
Instance Attribute Summary (collapse)
-
- (Object) ast
(also: #root)
readonly
Returns the value of attribute ast.
-
- (Object) charno
readonly
Returns the value of attribute charno.
-
- (Object) comments
readonly
Returns the value of attribute comments.
-
- (Object) file
readonly
Returns the value of attribute file.
-
- (Object) tokens
readonly
Returns the value of attribute tokens.
Instance Method Summary (collapse)
- - (Object) enumerator
-
- (RipperParser) initialize(source, filename, *args)
constructor
A new instance of RipperParser.
- - (Object) parse
Constructor Details
- (RipperParser) initialize(source, filename, *args)
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
- (Object) ast (readonly) Also known as: root
Returns the value of attribute ast
20 21 22 |
# File 'lib/yard/parser/ruby/ruby_parser.rb', line 20 def ast @ast end |
- (Object) charno (readonly)
Returns the value of attribute charno
20 21 22 |
# File 'lib/yard/parser/ruby/ruby_parser.rb', line 20 def charno @charno end |
- (Object) comments (readonly)
Returns the value of attribute comments
20 21 22 |
# File 'lib/yard/parser/ruby/ruby_parser.rb', line 20 def comments @comments end |
- (Object) file (readonly)
Returns the value of attribute file
20 21 22 |
# File 'lib/yard/parser/ruby/ruby_parser.rb', line 20 def file @file end |
- (Object) tokens (readonly)
Returns the value of attribute tokens
20 21 22 |
# File 'lib/yard/parser/ruby/ruby_parser.rb', line 20 def tokens @tokens end |
Instance Method Details
- (Object) enumerator
46 47 48 |
# File 'lib/yard/parser/ruby/ruby_parser.rb', line 46 def enumerator ast.children end |
- (Object) parse
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 |