sass 3.3.0.alpha.149 → 3.3.0.alpha.162
Sign up to get free protection for your applications and to get access to all the features.
- data/REVISION +1 -1
- data/VERSION +1 -1
- data/VERSION_DATE +1 -1
- data/lib/sass/css.rb +1 -1
- data/lib/sass/engine.rb +4 -4
- data/lib/sass/environment.rb +1 -1
- data/lib/sass/exec.rb +1 -1
- data/lib/sass/media.rb +15 -15
- data/lib/sass/script.rb +32 -7
- data/lib/sass/script/css_lexer.rb +2 -2
- data/lib/sass/script/css_parser.rb +1 -1
- data/lib/sass/script/functions.rb +246 -232
- data/lib/sass/script/lexer.rb +24 -32
- data/lib/sass/script/parser.rb +84 -65
- data/lib/sass/script/tree.rb +14 -0
- data/lib/sass/script/tree/funcall.rb +242 -0
- data/lib/sass/script/{interpolation.rb → tree/interpolation.rb} +30 -13
- data/lib/sass/script/tree/list_literal.rb +65 -0
- data/lib/sass/script/tree/literal.rb +46 -0
- data/lib/sass/script/{node.rb → tree/node.rb} +10 -10
- data/lib/sass/script/{operation.rb → tree/operation.rb} +16 -27
- data/lib/sass/script/{string_interpolation.rb → tree/string_interpolation.rb} +4 -4
- data/lib/sass/script/{unary_operation.rb → tree/unary_operation.rb} +7 -8
- data/lib/sass/script/tree/variable.rb +56 -0
- data/lib/sass/script/value.rb +10 -0
- data/lib/sass/script/{arg_list.rb → value/arg_list.rb} +5 -20
- data/lib/sass/script/value/base.rb +222 -0
- data/lib/sass/script/{bool.rb → value/bool.rb} +2 -2
- data/lib/sass/script/{color.rb → value/color.rb} +22 -20
- data/lib/sass/script/{list.rb → value/list.rb} +15 -28
- data/lib/sass/script/{null.rb → value/null.rb} +3 -3
- data/lib/sass/script/{number.rb → value/number.rb} +19 -19
- data/lib/sass/script/{string.rb → value/string.rb} +7 -7
- data/lib/sass/scss/parser.rb +14 -4
- data/lib/sass/selector.rb +26 -26
- data/lib/sass/selector/abstract_sequence.rb +1 -1
- data/lib/sass/selector/simple.rb +6 -7
- data/lib/sass/source/position.rb +13 -0
- data/lib/sass/supports.rb +4 -4
- data/lib/sass/tree/comment_node.rb +3 -3
- data/lib/sass/tree/css_import_node.rb +7 -7
- data/lib/sass/tree/debug_node.rb +2 -2
- data/lib/sass/tree/directive_node.rb +2 -2
- data/lib/sass/tree/each_node.rb +2 -2
- data/lib/sass/tree/extend_node.rb +4 -4
- data/lib/sass/tree/for_node.rb +4 -4
- data/lib/sass/tree/function_node.rb +4 -4
- data/lib/sass/tree/media_node.rb +3 -3
- data/lib/sass/tree/mixin_def_node.rb +4 -4
- data/lib/sass/tree/mixin_node.rb +6 -6
- data/lib/sass/tree/prop_node.rb +23 -15
- data/lib/sass/tree/return_node.rb +2 -2
- data/lib/sass/tree/rule_node.rb +3 -3
- data/lib/sass/tree/variable_node.rb +2 -2
- data/lib/sass/tree/visitors/convert.rb +2 -2
- data/lib/sass/tree/visitors/deep_copy.rb +5 -5
- data/lib/sass/tree/visitors/perform.rb +7 -7
- data/lib/sass/tree/visitors/set_options.rb +6 -6
- data/lib/sass/tree/visitors/to_css.rb +1 -1
- data/lib/sass/tree/warn_node.rb +2 -2
- data/lib/sass/tree/while_node.rb +2 -2
- data/lib/sass/util.rb +2 -2
- data/test/sass/engine_test.rb +6 -6
- data/test/sass/functions_test.rb +20 -20
- data/test/sass/plugin_test.rb +2 -2
- data/test/sass/script_test.rb +38 -29
- data/test/test_helper.rb +1 -1
- metadata +23 -19
- data/lib/sass/script/funcall.rb +0 -238
- data/lib/sass/script/literal.rb +0 -221
- data/lib/sass/script/variable.rb +0 -58
data/lib/sass/script/variable.rb
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
module Sass
|
2
|
-
module Script
|
3
|
-
# A SassScript parse node representing a variable.
|
4
|
-
class Variable < Node
|
5
|
-
# The name of the variable.
|
6
|
-
#
|
7
|
-
# @return [String]
|
8
|
-
attr_reader :name
|
9
|
-
|
10
|
-
# The underscored name of the variable.
|
11
|
-
#
|
12
|
-
# @return [String]
|
13
|
-
attr_reader :underscored_name
|
14
|
-
|
15
|
-
# @param name [String] See \{#name}
|
16
|
-
def initialize(name)
|
17
|
-
@name = name
|
18
|
-
@underscored_name = name.gsub(/-/,"_")
|
19
|
-
super()
|
20
|
-
end
|
21
|
-
|
22
|
-
# @return [String] A string representation of the variable
|
23
|
-
def inspect(opts = {})
|
24
|
-
"$#{dasherize(name, opts)}"
|
25
|
-
end
|
26
|
-
alias_method :to_sass, :inspect
|
27
|
-
|
28
|
-
# Returns an empty array.
|
29
|
-
#
|
30
|
-
# @return [Array<Node>] empty
|
31
|
-
# @see Node#children
|
32
|
-
def children
|
33
|
-
[]
|
34
|
-
end
|
35
|
-
|
36
|
-
# @see Node#deep_copy
|
37
|
-
def deep_copy
|
38
|
-
dup
|
39
|
-
end
|
40
|
-
|
41
|
-
protected
|
42
|
-
|
43
|
-
# Evaluates the variable.
|
44
|
-
#
|
45
|
-
# @param environment [Sass::Environment] The environment in which to evaluate the SassScript
|
46
|
-
# @return [Literal] The SassScript object that is the value of the variable
|
47
|
-
# @raise [Sass::SyntaxError] if the variable is undefined
|
48
|
-
def _perform(environment)
|
49
|
-
raise SyntaxError.new("Undefined variable: \"$#{name}\".") unless val = environment.var(name)
|
50
|
-
if val.is_a?(Number)
|
51
|
-
val = val.dup
|
52
|
-
val.original = nil
|
53
|
-
end
|
54
|
-
return val
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|