sass 3.3.0.alpha.225 → 3.3.0.alpha.226

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/REVISION CHANGED
@@ -1 +1 @@
1
- 7cb26b56b51286f6ac8361f9aa3f975f8749634a
1
+ 7fe98c2764d755aaa625069cdf8193d598e628cf
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.3.0.alpha.225
1
+ 3.3.0.alpha.226
data/VERSION_DATE CHANGED
@@ -1 +1 @@
1
- 07 August 2013 23:47:30 GMT
1
+ 08 August 2013 00:37:16 GMT
@@ -4,8 +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 [Node] The parse-tree node for the object of the operator
8
- # @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}
9
15
  def initialize(operand, operator)
10
16
  @operand = operand
11
17
  @operator = operator
@@ -47,7 +47,8 @@ module Sass::Script::Value
47
47
  return "()" if value.empty?
48
48
  precedence = Sass::Script::Parser.precedence_of(separator)
49
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
50
+ if v.is_a?(List) && Sass::Script::Parser.precedence_of(v.separator) <= precedence ||
51
+ separator == :space && v.is_a?(UnaryOperation) && (v.operator == :minus || v.operator == :plus)
51
52
  "(#{v.to_sass(opts)})"
52
53
  else
53
54
  v.to_sass(opts)
@@ -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: 592302799
4
+ hash: 592302793
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 3
8
8
  - 3
9
9
  - 0
10
10
  - alpha
11
- - 225
12
- version: 3.3.0.alpha.225
11
+ - 226
12
+ version: 3.3.0.alpha.226
13
13
  platform: ruby
14
14
  authors:
15
15
  - Nathan Weizenbaum