Class: YARD::Parser::OrderedParser
- Inherits:
-
Object
- Object
- YARD::Parser::OrderedParser
- Defined in:
- lib/yard/parser/source_parser.rb
Overview
Responsible for parsing a list of files in order. The #parse method of this class can be called from the SourceParser#globals globals state list to re-enter parsing for the remainder of files in the list recursively.
Instance Attribute Summary collapse
-
#files ⇒ Array<String>
The list of remaining files to parse.
Instance Method Summary collapse
-
#initialize(global_state, files) ⇒ OrderedParser
constructor
Creates a new OrderedParser with the global state and a list of files to parse.
-
#parse ⇒ Object
Parses the remainder of the #files list.
Constructor Details
#initialize(global_state, files) ⇒ OrderedParser
Note:
OrderedParser sets itself as the ordered_parser
key on global_state for later use in Handlers::Processor.
Creates a new OrderedParser with the global state and a list of files to parse.
32 33 34 35 36 |
# File 'lib/yard/parser/source_parser.rb', line 32 def initialize(global_state, files) @global_state = global_state @files = files.dup @global_state.ordered_parser = self end |
Instance Attribute Details
Instance Method Details
#parse ⇒ Object
Parses the remainder of the #files list.
41 42 43 44 45 46 47 48 |
# File 'lib/yard/parser/source_parser.rb', line 41 def parse until files.empty? file = files.shift log.capture("Parsing #{file}") do SourceParser.new(SourceParser.parser_type, @global_state).parse(file) end end end |