Loading lib/jsduck/lexer.rb +1 −1 Original line number Diff line number Diff line Loading @@ -140,7 +140,7 @@ module JsDuck elsif @input.check(/\//) # Several things begin with dash: # - comments, regexes, division-operators if @input.check(/\/\*\*/) if @input.check(/\/\*\*[^\/]/) return { :type => :doc_comment, # Calculate current line number, starting with 1 Loading spec/lexer_spec.rb +4 −0 Original line number Diff line number Diff line Loading @@ -127,6 +127,10 @@ describe JsDuck::Lexer do lex("a /* foo */ b").should == [[:ident, "a"], [:ident, "b"]] end it "ignores empty multi-line comments" do lex("a /**/ b").should == [[:ident, "a"], [:ident, "b"]] end it "identifies doc-comments together with line numbers" do lex("/** foo */").should == [[:doc_comment, "/** foo */", 1]] end Loading Loading
lib/jsduck/lexer.rb +1 −1 Original line number Diff line number Diff line Loading @@ -140,7 +140,7 @@ module JsDuck elsif @input.check(/\//) # Several things begin with dash: # - comments, regexes, division-operators if @input.check(/\/\*\*/) if @input.check(/\/\*\*[^\/]/) return { :type => :doc_comment, # Calculate current line number, starting with 1 Loading
spec/lexer_spec.rb +4 −0 Original line number Diff line number Diff line Loading @@ -127,6 +127,10 @@ describe JsDuck::Lexer do lex("a /* foo */ b").should == [[:ident, "a"], [:ident, "b"]] end it "ignores empty multi-line comments" do lex("a /**/ b").should == [[:ident, "a"], [:ident, "b"]] end it "identifies doc-comments together with line numbers" do lex("/** foo */").should == [[:doc_comment, "/** foo */", 1]] end Loading