Class: JsDuck::Css::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/jsduck/css/parser.rb

Overview

Parses SCSS using the official SASS parser.

Constant Summary collapse

TYPE =
Css::Type.new

Instance Method Summary collapse

Constructor Details

#initialize(input, options = {}) ⇒ Parser

Returns a new instance of Parser.



11
12
13
14
# File 'lib/jsduck/css/parser.rb', line 11

def initialize(input, options = {})
  @input = input
  @docs = []
end

Instance Method Details

#parseObject

Returns an array of docsets like the Js::Parser does.



17
18
19
20
21
# File 'lib/jsduck/css/parser.rb', line 17

def parse
  root = Sass::Engine.new(@input, :syntax => :scss).to_tree
  find_doc_comments(root.children)
  @docs
end