Loading doc_comment_parser.rb +3 −5 Original line number Diff line number Diff line Loading @@ -132,11 +132,9 @@ module JsDuck # matches @method name ... def at_method match(/@method/) # In case @method comes after the description, # turn the :default tag description into method description, # and afterwards delete it. set_root_tag(:method, @tags[:default] || {:doc => ""}) @root_tags.shift() if @root_tags[0][:default] # @method curses the current :default tag into :method. @current_tag = @tags[:method] = @tags[:default] @tags.delete(:default) skip_horiz_white if look(/\w/) then @current_tag[:name] = ident Loading tc_doc_comment_parser.rb +2 −0 Original line number Diff line number Diff line Loading @@ -37,10 +37,12 @@ class TestDocCommentParser < Test::Unit::TestCase * Method description * @param foo * @method blah * @return {String} */") assert_equal("blah", doc[:method][:name]) assert_equal("Method description", doc[:method][:doc]) assert_equal("foo", doc[:param][0][:name]) assert_equal("String", doc[:return][:type]) end def test_constructor Loading Loading
doc_comment_parser.rb +3 −5 Original line number Diff line number Diff line Loading @@ -132,11 +132,9 @@ module JsDuck # matches @method name ... def at_method match(/@method/) # In case @method comes after the description, # turn the :default tag description into method description, # and afterwards delete it. set_root_tag(:method, @tags[:default] || {:doc => ""}) @root_tags.shift() if @root_tags[0][:default] # @method curses the current :default tag into :method. @current_tag = @tags[:method] = @tags[:default] @tags.delete(:default) skip_horiz_white if look(/\w/) then @current_tag[:name] = ident Loading
tc_doc_comment_parser.rb +2 −0 Original line number Diff line number Diff line Loading @@ -37,10 +37,12 @@ class TestDocCommentParser < Test::Unit::TestCase * Method description * @param foo * @method blah * @return {String} */") assert_equal("blah", doc[:method][:name]) assert_equal("Method description", doc[:method][:doc]) assert_equal("foo", doc[:param][0][:name]) assert_equal("String", doc[:return][:type]) end def test_constructor Loading