[Sass] Added deprecation warning about the upcoming change to silent comments.
This commit is contained in:
parent
8a5ae5ba6d
commit
edc4c78df8
|
@ -136,6 +136,7 @@ module Sass
|
|||
def split_lines
|
||||
@line = 0
|
||||
old_tabs = nil
|
||||
last_line_was_comment = false
|
||||
@template.each_with_index do |line, index|
|
||||
@line += 1
|
||||
|
||||
|
@ -143,6 +144,19 @@ module Sass
|
|||
|
||||
if line[0] == COMMENT_CHAR && line[1] == SASS_COMMENT_CHAR && tabs == 0
|
||||
tabs = old_tabs
|
||||
last_line_was_comment = true
|
||||
elsif last_line_was_comment && tabs
|
||||
if tabs > 0
|
||||
context = "On line #{@line}"
|
||||
context << " of #{@options[:filename]}" if @options[:filename]
|
||||
warn <<ENDENDEND
|
||||
DEPRECATION WARNING:
|
||||
#{context}
|
||||
Silent comments (//) in version 2.2 will comment out the lines indented beneath them.
|
||||
Please indent line #{@line - 1} to match the surrounding indentation level
|
||||
ENDENDEND
|
||||
end
|
||||
last_line_was_comment = false
|
||||
end
|
||||
|
||||
if tabs # if line isn't blank
|
||||
|
|
|
@ -98,7 +98,13 @@ END
|
|||
end
|
||||
|
||||
def test_exception_line
|
||||
to_render = "rule\n :attr val\n// comment!\n\n :broken\n"
|
||||
to_render = <<SASS
|
||||
rule
|
||||
:attr val
|
||||
// comment!
|
||||
|
||||
:broken
|
||||
SASS
|
||||
begin
|
||||
Sass::Engine.new(to_render).render
|
||||
rescue Sass::SyntaxError => err
|
||||
|
|
|
@ -79,7 +79,6 @@ body
|
|||
:margin 0 5px
|
||||
:padding 5px 5px 0 5px
|
||||
:display inline
|
||||
// This comment is in the middle of this rule
|
||||
:font-size 1.1em
|
||||
// This comment is properly indented
|
||||
:color #fff
|
||||
|
|
Loading…
Reference in New Issue