Class: JsDuck::Parser
- Inherits:
-
Object
- Object
- JsDuck::Parser
- Defined in:
- lib/jsduck/parser.rb
Overview
Performs the actual parsing of SCSS or JS source.
This is the class that brings together all the different steps of parsing the source.
Instance Method Summary collapse
-
#initialize ⇒ Parser
constructor
A new instance of Parser.
-
#parse(contents, filename = "", options = {}) ⇒ Object
Parses file into final docset that can be fed into Aggregator.
Constructor Details
Instance Method Details
#parse(contents, filename = "", options = {}) ⇒ Object
Parses file into final docset that can be fed into Aggregator
27 28 29 30 31 32 33 34 35 |
# File 'lib/jsduck/parser.rb', line 27 def parse(contents, filename="", ={}) @doc_processor.filename = @filename = filename parse_js_or_scss(contents, filename, ).map do |docset| (docset) end.flatten.map do |docset| merge(docset) end end |