vendor/bundle/ruby/2.3.0/gems/sass-3.4.22/lib/sass/scss/parser.rb
# Expose for the SASS parser.
Expose for the SASS parser.
Expose for the SASS parser .
def process_comment(text, node)
        silent = text =~ %r{\A//}
        loud = !silent && text =~ %r{\A/[/*]!}
        line = @line - text.count("\n")
        comment_start = @scanner.pos - text.length
        index_before_line = @scanner.string.rindex("\n", comment_start) || -1
        offset = comment_start - index_before_line
        if silent
          value = [text.sub(%r{\A\s*//}, '/*').gsub(%r{^\s*//}, ' *') + ' */']
        else
          value = Sass::Engine.parse_interp(text, line, offset, :filename => @filename)
          line_before_comment = @scanner.string[index_before_line + 1...comment_start]
          value.unshift(line_before_comment.gsub(/[^\s]/, ' '))
        end
        type = if silent
                 :silent
               elsif loud
                 :loud
               else
                 :normal
               end
        start_pos = Sass::Source::Position.new(line, offset)
        comment = node(Sass::Tree::CommentNode.new(value, type), start_pos)
        node << comment
      end
def process_comment ( text , node ) silent = text =~ %r{ \A // } loud = ! silent && text =~ %r{ \A /[/*]! } line = @line - text . count ( "\n" ) comment_start = @scanner . pos - text . length index_before_line = @scanner . string . rindex ( "\n" , comment_start ) || - 1 offset = comment_start - index_before_line if silent value = [ text . sub ( %r{ \A \s *// } , '/*' ) . gsub ( %r{ ^ \s *// } , ' *' ) + ' */' ] else value = Sass :: Engine . parse_interp ( text , line , offset , :filename => @filename ) line_before_comment = @scanner . string [ index_before_line + 1 ... comment_start ] value . unshift ( line_before_comment . gsub ( / [^ \s ] / , ' ' ) ) end type = if silent :silent elsif loud :loud else :normal end start_pos = Sass :: Source :: Position . new ( line , offset ) comment = node ( Sass :: Tree :: CommentNode . new ( value , type ) , start_pos ) node << comment end
Expose for the SASS parser.
Expose for the SASS parser .
text
<not_specific>
node
<not_specific>