Loading lib/jsduck/type_parser.rb +3 −4 Original line number Diff line number Diff line Loading @@ -46,9 +46,6 @@ module JsDuck return false unless base_type end # The definition might end with an ellipsis @out << "..." if @input.scan(/\.\.\./) # Concatenate all output @out = @out.join Loading @@ -58,7 +55,7 @@ module JsDuck # The basic type # # <ident> [ "." <ident> ]* [ "[]" ] # <ident> [ "." <ident> ]* [ "[]" ] [ "..." ] # # dot-separated identifiers followed by optional "[]" def base_type Loading @@ -77,6 +74,8 @@ module JsDuck @out << "[]" if @input.scan(/\[\]/) @out << "..." if @input.scan(/\.\.\./) true end Loading spec/type_parser_spec.rb +4 −4 Original line number Diff line number Diff line Loading @@ -60,6 +60,10 @@ describe JsDuck::TypeParser do it "complex alteration" do parse("Ext.form.Panel[]/Number/Ext.Element...").should == true end it "in the middle" do parse("Number.../String").should == true end end describe "doesn't match" do Loading Loading @@ -90,10 +94,6 @@ describe JsDuck::TypeParser do it "/ at the end" do parse("Number/").should == false end it "... in the middle" do parse("Number.../String").should == false end end end Loading Loading
lib/jsduck/type_parser.rb +3 −4 Original line number Diff line number Diff line Loading @@ -46,9 +46,6 @@ module JsDuck return false unless base_type end # The definition might end with an ellipsis @out << "..." if @input.scan(/\.\.\./) # Concatenate all output @out = @out.join Loading @@ -58,7 +55,7 @@ module JsDuck # The basic type # # <ident> [ "." <ident> ]* [ "[]" ] # <ident> [ "." <ident> ]* [ "[]" ] [ "..." ] # # dot-separated identifiers followed by optional "[]" def base_type Loading @@ -77,6 +74,8 @@ module JsDuck @out << "[]" if @input.scan(/\[\]/) @out << "..." if @input.scan(/\.\.\./) true end Loading
spec/type_parser_spec.rb +4 −4 Original line number Diff line number Diff line Loading @@ -60,6 +60,10 @@ describe JsDuck::TypeParser do it "complex alteration" do parse("Ext.form.Panel[]/Number/Ext.Element...").should == true end it "in the middle" do parse("Number.../String").should == true end end describe "doesn't match" do Loading Loading @@ -90,10 +94,6 @@ describe JsDuck::TypeParser do it "/ at the end" do parse("Number/").should == false end it "... in the middle" do parse("Number.../String").should == false end end end Loading