haml-edge 2.3.212 → 2.3.213
Sign up to get free protection for your applications and to get access to all the features.
- data/EDGE_GEM_VERSION +1 -1
- data/VERSION +1 -1
- data/lib/sass/engine.rb +4 -0
- data/lib/sass/scss/parser.rb +3 -0
- data/lib/sass/scss/static_parser.rb +2 -2
- data/lib/sass/tree/extend_node.rb +2 -2
- data/lib/sass/tree/rule_node.rb +2 -2
- data/test/sass/conversion_test.rb +4 -0
- data/test/sass/engine_test.rb +6 -0
- data/test/sass/scss/css_test.rb +2 -0
- data/test/sass/scss/scss_test.rb +5 -3
- metadata +1 -1
data/EDGE_GEM_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.3.
|
1
|
+
2.3.213
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.3.
|
1
|
+
2.3.213
|
data/lib/sass/engine.rb
CHANGED
@@ -408,11 +408,15 @@ WARNING
|
|
408
408
|
return Tree::RuleNode.new(parse_interp(line.text))
|
409
409
|
end
|
410
410
|
res.unshift(hack_char) if hack_char
|
411
|
+
if comment = scanner.scan(Sass::SCSS::RX::COMMENT)
|
412
|
+
res << comment
|
413
|
+
end
|
411
414
|
|
412
415
|
name = line.text[0...scanner.pos]
|
413
416
|
if scanner.scan(/\s*([:=])(?:\s|$)/)
|
414
417
|
parse_property(name, res, scanner[1], scanner.rest, :new, line)
|
415
418
|
else
|
419
|
+
res.pop if comment
|
416
420
|
Tree::RuleNode.new(res + parse_interp(scanner.rest))
|
417
421
|
end
|
418
422
|
end
|
data/lib/sass/scss/parser.rb
CHANGED
@@ -15,7 +15,7 @@ module Sass
|
|
15
15
|
# Used for error reporting
|
16
16
|
# @return [Selector::CommaSequence] The parsed selector
|
17
17
|
# @raise [Sass::SyntaxError] if there's a syntax error in the selector
|
18
|
-
def parse_selector(
|
18
|
+
def parse_selector(filename)
|
19
19
|
init_scanner!
|
20
20
|
selectors = [expr!(:_selector)]
|
21
21
|
while tok(/,/)
|
@@ -25,7 +25,7 @@ module Sass
|
|
25
25
|
end
|
26
26
|
expected("selector") unless @scanner.eos?
|
27
27
|
seq = Selector::CommaSequence.new(selectors)
|
28
|
-
seq.line = line
|
28
|
+
seq.line = @line
|
29
29
|
seq.filename = filename
|
30
30
|
seq
|
31
31
|
end
|
@@ -52,8 +52,8 @@ module Sass::Tree
|
|
52
52
|
# @param environment [Sass::Environment] The lexical environment containing
|
53
53
|
# variable and mixin values
|
54
54
|
def perform!(environment)
|
55
|
-
@resolved_selector = Sass::SCSS::CssParser.new(run_interp(@selector, environment)).
|
56
|
-
parse_selector(self.
|
55
|
+
@resolved_selector = Sass::SCSS::CssParser.new(run_interp(@selector, environment), self.line).
|
56
|
+
parse_selector(self.filename)
|
57
57
|
super
|
58
58
|
end
|
59
59
|
end
|
data/lib/sass/tree/rule_node.rb
CHANGED
@@ -191,8 +191,8 @@ module Sass::Tree
|
|
191
191
|
# @param environment [Sass::Environment] The lexical environment containing
|
192
192
|
# variable and mixin values
|
193
193
|
def perform!(environment)
|
194
|
-
@parsed_rules = Sass::SCSS::StaticParser.new(run_interp(@rule, environment)).
|
195
|
-
parse_selector(self.
|
194
|
+
@parsed_rules = Sass::SCSS::StaticParser.new(run_interp(@rule, environment), self.line).
|
195
|
+
parse_selector(self.filename)
|
196
196
|
super
|
197
197
|
end
|
198
198
|
|
@@ -872,6 +872,8 @@ foo
|
|
872
872
|
*name: val
|
873
873
|
#name: val
|
874
874
|
.name: val
|
875
|
+
name/**/: val
|
876
|
+
name/*\\**/: val
|
875
877
|
name: val
|
876
878
|
SASS
|
877
879
|
foo {
|
@@ -879,6 +881,8 @@ foo {
|
|
879
881
|
*name: val;
|
880
882
|
#name: val;
|
881
883
|
.name: val;
|
884
|
+
name/**/: val;
|
885
|
+
name/*\\**/: val;
|
882
886
|
name: val; }
|
883
887
|
SCSS
|
884
888
|
end
|
data/test/sass/engine_test.rb
CHANGED
@@ -32,6 +32,8 @@ MSG
|
|
32
32
|
"a\n :b:c d" => 'Invalid property: ":b:c d".',
|
33
33
|
"a\n :b c;" => 'Invalid CSS after "c": expected expression (e.g. 1px, bold), was ";"',
|
34
34
|
"a\n b: c;" => 'Invalid CSS after "c": expected expression (e.g. 1px, bold), was ";"',
|
35
|
+
".foo ^bar\n a: b" => ['Invalid CSS after ".foo ": expected selector, was "^bar"', 1],
|
36
|
+
"a\n @extend .foo ^bar" => 'Invalid CSS after ".foo ": expected selector, was "^bar"',
|
35
37
|
"a: b" => 'Properties aren\'t allowed at the root of a document.',
|
36
38
|
":a b" => 'Properties aren\'t allowed at the root of a document.',
|
37
39
|
"!" => 'Invalid variable: "!".',
|
@@ -599,6 +601,8 @@ foo {
|
|
599
601
|
*name: val;
|
600
602
|
#name: val;
|
601
603
|
.name: val;
|
604
|
+
name/**/: val;
|
605
|
+
name/*\\**/: val;
|
602
606
|
name: val; }
|
603
607
|
CSS
|
604
608
|
foo
|
@@ -606,6 +610,8 @@ foo
|
|
606
610
|
*name: val
|
607
611
|
#name: val
|
608
612
|
.name: val
|
613
|
+
name/**/: val
|
614
|
+
name/*\\**/: val
|
609
615
|
name: val
|
610
616
|
SASS
|
611
617
|
end
|
data/test/sass/scss/css_test.rb
CHANGED
data/test/sass/scss/scss_test.rb
CHANGED
@@ -942,9 +942,11 @@ SCSS
|
|
942
942
|
end
|
943
943
|
|
944
944
|
def test_post_resolution_selector_error
|
945
|
-
|
946
|
-
|
947
|
-
|
945
|
+
render "\n\nfoo \#{\") bar\"} {a: b}"
|
946
|
+
assert(false, "Expected syntax error")
|
947
|
+
rescue Sass::SyntaxError => e
|
948
|
+
assert_equal 'Invalid CSS after "foo ": expected selector, was ") bar"', e.message
|
949
|
+
assert_equal 3, e.sass_line
|
948
950
|
end
|
949
951
|
|
950
952
|
def test_parent_in_mid_selector_error
|