Loading lib/jsduck/css_parser.rb +1 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ module JsDuck class CssParser def initialize(input, options = {}) @lex = Lexer.new(input) @doc_parser = DocParser.new(:css) @doc_parser = DocParser.new @docs = [] end Loading lib/jsduck/doc_parser.rb +3 −4 Original line number Diff line number Diff line Loading @@ -24,10 +24,9 @@ module JsDuck # @see and {@link} are parsed separately in JsDuck::DocFormatter. # class DocParser # Pass in :css to be able to parse CSS doc-comments def initialize(mode = :js) @ident_pattern = (mode == :css) ? /\$?[\w-]+/ : /[$\w]\w*/ @ident_chain_pattern = (mode == :css) ? /\$?[\w-]+(\.[\w-]+)*/ : /[$\w]\w*(\.\w+)*/ def initialize @ident_pattern = /[$\w-]+/ @ident_chain_pattern = /[$\w-]+(\.[$\w-]+)*/ @meta_tags = MetaTagRegistry.instance end Loading lib/jsduck/js_parser.rb +1 −1 Original line number Diff line number Diff line Loading @@ -8,7 +8,7 @@ module JsDuck class JsParser < JsLiteralParser def initialize(input, options = {}) super(input) @doc_parser = DocParser.new(:js) @doc_parser = DocParser.new @docs = [] @ext_namespaces = options[:ext_namespaces] || ["Ext"] end Loading spec/aggregator_cfgs_and_properties_spec.rb +14 −0 Original line number Diff line number Diff line Loading @@ -130,6 +130,20 @@ describe JsDuck::Aggregator do it_should_behave_like "cfg or property default type" end describe "@cfg with dash in name" do before do @doc = parse(<<-EOS)[0] /** * @cfg {String} foo-bar * Some documentation. */ EOS end it "detects the name" do @doc[:name].should == "foo-bar" end end shared_examples_for "auto type" do it "should imply correct type" do @doc[:type].should == @type Loading Loading
lib/jsduck/css_parser.rb +1 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ module JsDuck class CssParser def initialize(input, options = {}) @lex = Lexer.new(input) @doc_parser = DocParser.new(:css) @doc_parser = DocParser.new @docs = [] end Loading
lib/jsduck/doc_parser.rb +3 −4 Original line number Diff line number Diff line Loading @@ -24,10 +24,9 @@ module JsDuck # @see and {@link} are parsed separately in JsDuck::DocFormatter. # class DocParser # Pass in :css to be able to parse CSS doc-comments def initialize(mode = :js) @ident_pattern = (mode == :css) ? /\$?[\w-]+/ : /[$\w]\w*/ @ident_chain_pattern = (mode == :css) ? /\$?[\w-]+(\.[\w-]+)*/ : /[$\w]\w*(\.\w+)*/ def initialize @ident_pattern = /[$\w-]+/ @ident_chain_pattern = /[$\w-]+(\.[$\w-]+)*/ @meta_tags = MetaTagRegistry.instance end Loading
lib/jsduck/js_parser.rb +1 −1 Original line number Diff line number Diff line Loading @@ -8,7 +8,7 @@ module JsDuck class JsParser < JsLiteralParser def initialize(input, options = {}) super(input) @doc_parser = DocParser.new(:js) @doc_parser = DocParser.new @docs = [] @ext_namespaces = options[:ext_namespaces] || ["Ext"] end Loading
spec/aggregator_cfgs_and_properties_spec.rb +14 −0 Original line number Diff line number Diff line Loading @@ -130,6 +130,20 @@ describe JsDuck::Aggregator do it_should_behave_like "cfg or property default type" end describe "@cfg with dash in name" do before do @doc = parse(<<-EOS)[0] /** * @cfg {String} foo-bar * Some documentation. */ EOS end it "detects the name" do @doc[:name].should == "foo-bar" end end shared_examples_for "auto type" do it "should imply correct type" do @doc[:type].should == @type Loading