Commit 52db36dc authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Detect line numbers with new SASS parser.

parent 2ca779b1
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -28,14 +28,14 @@ module JsDuck
        nodes.each do |node|
          if node.class == Sass::Tree::CommentNode
            if node.type == :normal && node.value[0] =~ /\A\/\*\*/
              prev_comment = node.value[0]
              prev_comment = node
            else
              prev_comment = nil
            end
          elsif prev_comment
            @docs << {
              :comment => prev_comment,
              :linenr => 0,
              :comment => prev_comment.value[0],
              :linenr => prev_comment.line,
              :code => analyze_code(node),
              :type => :doc_comment,
            }
+4 −0
Original line number Diff line number Diff line
@@ -65,6 +65,10 @@ describe JsDuck::Css::SassParser do
      var[:comment].should == "/** My variable */"
    end

    it "detects line number" do
      var[:linenr].should == 1
    end

    it "detects :css_var type" do
      var[:code][:tagname].should == :css_var
    end