sass 3.3.0.alpha.227 → 3.3.0.alpha.229

Sign up to get free protection for your applications and to get access to all the features.
data/REVISION CHANGED
@@ -1 +1 @@
1
- 22370c84a7b6617813436fa3fd952f89a7821528
1
+ 7ff8fef1739f20466b1b9e9330a99fe4f7ca83e9
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.3.0.alpha.227
1
+ 3.3.0.alpha.229
data/VERSION_DATE CHANGED
@@ -1 +1 @@
1
- 09 August 2013 20:00:43 GMT
1
+ 12 August 2013 23:04:10 GMT
@@ -25,19 +25,21 @@ module Sass::Script::Tree
25
25
  # @see Node#children
26
26
  def children; elements; end
27
27
 
28
- # @see Node#to_sass
28
+ # @see Value#to_sass
29
29
  def to_sass(opts = {})
30
30
  return "()" if elements.empty?
31
31
  precedence = Sass::Script::Parser.precedence_of(separator)
32
- elements.map do |v|
33
- if v.is_a?(ListLiteral) && Sass::Script::Parser.precedence_of(v.separator) <= precedence
32
+ elements.reject {|e| e.is_a?(Sass::Script::Value::Null)}.map do |v|
33
+ if v.is_a?(ListLiteral) && Sass::Script::Parser.precedence_of(v.separator) <= precedence ||
34
+ separator == :space && v.is_a?(UnaryOperation) && (v.operator == :minus || v.operator == :plus)
34
35
  "(#{v.to_sass(opts)})"
35
36
  else
36
37
  v.to_sass(opts)
37
38
  end
38
- end.join(separator == :space ? ' ' : ', ')
39
+ end.join(sep_str(nil))
39
40
  end
40
41
 
42
+
41
43
  # @see Node#deep_copy
42
44
  def deep_copy
43
45
  node = dup
@@ -61,5 +63,13 @@ module Sass::Script::Tree
61
63
  list.options = self.options
62
64
  list
63
65
  end
66
+
67
+ private
68
+
69
+ def sep_str(opts = self.options)
70
+ return ' ' if separator == :space
71
+ return ',' if opts && opts[:style] == :compressed
72
+ return ', '
73
+ end
64
74
  end
65
75
  end
@@ -4,9 +4,14 @@ module Sass::Script::Tree
4
4
  #
5
5
  # Currently only `-`, `/`, and `not` are unary operators.
6
6
  class UnaryOperation < Node
7
- # @param operand [Script::Node] The parse-tree node
8
- # for the object of the operator
9
- # @param operator [Symbol] The operator to perform
7
+ # @return [Symbol] The operation to perform
8
+ attr_reader :operator
9
+
10
+ # @return [Script::Node] The parse-tree node for the object of the operator
11
+ attr_reader :operand
12
+
13
+ # @param operand [Script::Node] See \{#operand}
14
+ # @param operator [Symbol] See \{#operator}
10
15
  def initialize(operand, operator)
11
16
  @operand = operand
12
17
  @operator = operator
@@ -42,19 +42,6 @@ module Sass::Script::Value
42
42
  return value.reject {|e| e.is_a?(Null) || e.is_a?(List) && e.value.empty?}.map {|e| e.to_s(opts)}.join(sep_str)
43
43
  end
44
44
 
45
- # @see Value#to_sass
46
- def to_sass(opts = {})
47
- return "()" if value.empty?
48
- precedence = Sass::Script::Parser.precedence_of(separator)
49
- value.reject {|e| e.is_a?(Null)}.map do |v|
50
- if v.is_a?(List) && Sass::Script::Parser.precedence_of(v.separator) <= precedence
51
- "(#{v.to_sass(opts)})"
52
- else
53
- v.to_sass(opts)
54
- end
55
- end.join(sep_str(nil))
56
- end
57
-
58
45
  # @see Value#inspect
59
46
  def inspect
60
47
  "(#{value.map {|e| e.inspect}.join(sep_str(nil))})"
@@ -1742,6 +1742,23 @@ $foo: foo($dash-ed: 2px, $under_scored: 1px);
1742
1742
  SCSS
1743
1743
  end
1744
1744
 
1745
+ def test_ambiguous_negation
1746
+ assert_renders(<<SASS, <<SCSS, :indent => ' ')
1747
+ foo
1748
+ ok: -$foo
1749
+ comma: 10px, -$foo
1750
+ needs-parens: 10px (-$foo)
1751
+ no-parens: a 50px + 60px b
1752
+ SASS
1753
+ foo {
1754
+ ok: -$foo;
1755
+ comma: 10px, -$foo;
1756
+ needs-parens: 10px (-$foo);
1757
+ no-parens: a 50px + 60px b;
1758
+ }
1759
+ SCSS
1760
+ end
1761
+
1745
1762
  private
1746
1763
 
1747
1764
  def assert_sass_to_sass(sass, options = {})
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sass
3
3
  version: !ruby/object:Gem::Version
4
- hash: 592302795
4
+ hash: 592302791
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 3
8
8
  - 3
9
9
  - 0
10
10
  - alpha
11
- - 227
12
- version: 3.3.0.alpha.227
11
+ - 229
12
+ version: 3.3.0.alpha.229
13
13
  platform: ruby
14
14
  authors:
15
15
  - Nathan Weizenbaum
@@ -19,7 +19,7 @@ autorequire:
19
19
  bindir: bin
20
20
  cert_chain: []
21
21
 
22
- date: 2013-08-09 00:00:00 -04:00
22
+ date: 2013-08-12 00:00:00 -04:00
23
23
  default_executable:
24
24
  dependencies:
25
25
  - !ruby/object:Gem::Dependency