Loading lib/jsduck/css_parser.rb +7 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,13 @@ module JsDuck def code_block if look("@", "mixin") mixin elsif look(:ident) name = css_ident if name =~ /\A\$/ && look(":") {:type => :css_var, :name => name} else {:type => :nop} end else {:type => :nop} end Loading lib/jsduck/merger.rb +3 −1 Original line number Diff line number Diff line Loading @@ -63,6 +63,8 @@ module JsDuck :class elsif code[:type] == :css_mixin :css_mixin elsif code[:type] == :css_var :css_var elsif doc_map[:cfg] :cfg elsif code[:type] == :function Loading Loading @@ -251,7 +253,7 @@ module JsDuck main_tag[:name] elsif doc_map[:constructor] "constructor" elsif code[:type] == :function || code[:type] == :css_mixin elsif code[:type] == :function || code[:type] == :css_mixin || code[:type] == :css_var code[:name] elsif code[:type] == :assignment name_type == :full_name ? code[:left].join(".") : code[:left].last Loading spec/aggregator_css_spec.rb +18 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,24 @@ describe JsDuck::Aggregator do end end describe "CSS doc-comment followed with $var-name:" do before do @doc = parse(<<-EOCSS)[0] /** * Default height for buttons. */ $button-height: 25px; EOCSS end it "detects variable" do @doc[:tagname].should == :css_var end it "detects variable name" do @doc[:name].should == "$button-height" end end describe "CSS doc-comment followed by @mixin" do before do @doc = parse(<<-EOCSS)[0] Loading Loading
lib/jsduck/css_parser.rb +7 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,13 @@ module JsDuck def code_block if look("@", "mixin") mixin elsif look(:ident) name = css_ident if name =~ /\A\$/ && look(":") {:type => :css_var, :name => name} else {:type => :nop} end else {:type => :nop} end Loading
lib/jsduck/merger.rb +3 −1 Original line number Diff line number Diff line Loading @@ -63,6 +63,8 @@ module JsDuck :class elsif code[:type] == :css_mixin :css_mixin elsif code[:type] == :css_var :css_var elsif doc_map[:cfg] :cfg elsif code[:type] == :function Loading Loading @@ -251,7 +253,7 @@ module JsDuck main_tag[:name] elsif doc_map[:constructor] "constructor" elsif code[:type] == :function || code[:type] == :css_mixin elsif code[:type] == :function || code[:type] == :css_mixin || code[:type] == :css_var code[:name] elsif code[:type] == :assignment name_type == :full_name ? code[:left].join(".") : code[:left].last Loading
spec/aggregator_css_spec.rb +18 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,24 @@ describe JsDuck::Aggregator do end end describe "CSS doc-comment followed with $var-name:" do before do @doc = parse(<<-EOCSS)[0] /** * Default height for buttons. */ $button-height: 25px; EOCSS end it "detects variable" do @doc[:tagname].should == :css_var end it "detects variable name" do @doc[:name].should == "$button-height" end end describe "CSS doc-comment followed by @mixin" do before do @doc = parse(<<-EOCSS)[0] Loading