Loading lib/jsduck/doc_parser.rb +2 −2 Original line number Diff line number Diff line Loading @@ -25,8 +25,8 @@ module JsDuck class DocParser # Pass in :css to be able to parse CSS doc-comments def initialize(mode = :js) @ident_pattern = (mode == :css) ? /\$[\w-]*/ : /\w+/ @ident_chain_pattern = (mode == :css) ? /\$[\w-]+(\.[\w-]+)*/ : /\w+(\.\w+)*/ @ident_pattern = (mode == :css) ? /\$?[\w-]+/ : /[$\w]\w*/ @ident_chain_pattern = (mode == :css) ? /\$?[\w-]+(\.[\w-]+)*/ : /[$\w]\w*(\.\w+)*/ end def parse(input) Loading spec/aggregator_css_spec.rb +15 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,21 @@ describe JsDuck::Aggregator do end end describe "CSS @var with @member" do before do @doc = parse(<<-EOCSS)[0] /** * @var {measurement} $button-height Default height for buttons. * @member Ext.Button */ EOCSS end it "detects owner" do @doc[:owner].should == "Ext.Button" end end describe "CSS doc-comment followed by @mixin" do before do @doc = parse(<<-EOCSS)[0] Loading Loading
lib/jsduck/doc_parser.rb +2 −2 Original line number Diff line number Diff line Loading @@ -25,8 +25,8 @@ module JsDuck class DocParser # Pass in :css to be able to parse CSS doc-comments def initialize(mode = :js) @ident_pattern = (mode == :css) ? /\$[\w-]*/ : /\w+/ @ident_chain_pattern = (mode == :css) ? /\$[\w-]+(\.[\w-]+)*/ : /\w+(\.\w+)*/ @ident_pattern = (mode == :css) ? /\$?[\w-]+/ : /[$\w]\w*/ @ident_chain_pattern = (mode == :css) ? /\$?[\w-]+(\.[\w-]+)*/ : /[$\w]\w*(\.\w+)*/ end def parse(input) Loading
spec/aggregator_css_spec.rb +15 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,21 @@ describe JsDuck::Aggregator do end end describe "CSS @var with @member" do before do @doc = parse(<<-EOCSS)[0] /** * @var {measurement} $button-height Default height for buttons. * @member Ext.Button */ EOCSS end it "detects owner" do @doc[:owner].should == "Ext.Button" end end describe "CSS doc-comment followed by @mixin" do before do @doc = parse(<<-EOCSS)[0] Loading