# File lib/sass/less.rb, line 233 233: def to_sass_tree 234: if first.is_a?(Array) 235: val = map {|e| _to_sass_tree(e)}.inject(nil) do |e, i| 236: next i unless e 237: Sass::Script::Operation.new(e, i, :comma) 238: end 239: else 240: val = _to_sass_tree(self) 241: end 242: val.options = {} 243: val 244: end
# File lib/sass/less.rb, line 269 269: def _sass_split(arr) 270: return arr[0].to_sass_tree, arr[1..1] unless arr[0] == "(" 271: parens = 1 272: i = arr[1..1].each_with_index do |e, i| 273: parens += 1 if e == "(" 274: parens -= 1 if e == ")" 275: break i if parens == 0 276: end 277: 278: return _to_sass_tree(arr[1...i+1]), arr[i+2..1] 279: end
# File lib/sass/less.rb, line 249 249: def _to_sass_tree(arr) 250: return Sass::Script::UnaryOperation.new(_to_sass_tree(arr[1..1]), :minus) if arr[0] == "-" 251: _to_sass_tree2(*_sass_split(arr)) 252: end
# File lib/sass/less.rb, line 254 254: def _to_sass_tree2(first, rest) 255: return first if rest.empty? 256: if rest[0].is_a?(Operator) 257: op = LESS_TO_SASS_OPERATORS[rest[0]] 258: if op == :times || op == :div 259: second, rest = _sass_split(rest[1..1]) 260: return _to_sass_tree2(Sass::Script::Operation.new(first, second, op), rest) 261: else 262: return Sass::Script::Operation.new(first, _to_sass_tree(rest[1..1]), op) 263: end 264: end 265: 266: Sass::Script::Operation.new(first, _to_sass_tree(rest), :concat) 267: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.