Loading lib/jsduck/css_parser.rb +3 −2 Original line number Diff line number Diff line Loading @@ -27,14 +27,15 @@ module JsDuck @docs end # <code-block> := <mixin-declaration> | <var-declaration> | <nop> # <code-block> := <mixin-declaration> | <var-declaration> | <property> def code_block if look("@mixin") mixin_declaration elsif look(:var, ":") var_declaration else {:tagname => :nop} # Default to property like in JsParser. {:tagname => :property} end end Loading spec/aggregator_css_spec.rb +31 −0 Original line number Diff line number Diff line Loading @@ -259,5 +259,36 @@ describe JsDuck::Aggregator do end end describe "CSS doc-comment followed by CSS selector" do before do @doc = parse(<<-EOCSS)[0] /** * Some comment. */ .highlight { font-weight: bold; } EOCSS end it "gets detected as property" do @doc[:tagname].should == :property end end describe "CSS doc-comment followed by nothing" do before do @doc = parse(<<-EOCSS)[0] /** * Some comment. */ EOCSS end it "gets detected as property" do @doc[:tagname].should == :property end end end Loading
lib/jsduck/css_parser.rb +3 −2 Original line number Diff line number Diff line Loading @@ -27,14 +27,15 @@ module JsDuck @docs end # <code-block> := <mixin-declaration> | <var-declaration> | <nop> # <code-block> := <mixin-declaration> | <var-declaration> | <property> def code_block if look("@mixin") mixin_declaration elsif look(:var, ":") var_declaration else {:tagname => :nop} # Default to property like in JsParser. {:tagname => :property} end end Loading
spec/aggregator_css_spec.rb +31 −0 Original line number Diff line number Diff line Loading @@ -259,5 +259,36 @@ describe JsDuck::Aggregator do end end describe "CSS doc-comment followed by CSS selector" do before do @doc = parse(<<-EOCSS)[0] /** * Some comment. */ .highlight { font-weight: bold; } EOCSS end it "gets detected as property" do @doc[:tagname].should == :property end end describe "CSS doc-comment followed by nothing" do before do @doc = parse(<<-EOCSS)[0] /** * Some comment. */ EOCSS end it "gets detected as property" do @doc[:tagname].should == :property end end end