haml-edge 2.3.3 → 2.3.4
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/EDGE_GEM_VERSION +1 -1
- data/VERSION +1 -1
- data/lib/sass/script/lexer.rb +13 -1
- data/lib/sass/script/parser.rb +1 -1
- data/test/sass/script_test.rb +23 -5
- metadata +6 -6
data/EDGE_GEM_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.3.
|
1
|
+
2.3.4
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.3.
|
1
|
+
2.3.4
|
data/lib/sass/script/lexer.rb
CHANGED
@@ -65,10 +65,11 @@ module Sass
|
|
65
65
|
# Used for error reporting
|
66
66
|
# @param offset [Fixnum] The number of characters in on which the SassScript appears.
|
67
67
|
# Used for error reporting
|
68
|
-
def initialize(str, line, offset)
|
68
|
+
def initialize(str, line, offset, filename)
|
69
69
|
@scanner = str.is_a?(StringScanner) ? str : StringScanner.new(str)
|
70
70
|
@line = line
|
71
71
|
@offset = offset
|
72
|
+
@filename = filename
|
72
73
|
@prev = nil
|
73
74
|
end
|
74
75
|
|
@@ -158,7 +159,18 @@ module Sass
|
|
158
159
|
end
|
159
160
|
|
160
161
|
def op
|
162
|
+
prev_chr = @scanner.string[@scanner.pos - 1].chr
|
161
163
|
return unless op = @scanner.scan(REGULAR_EXPRESSIONS[:op])
|
164
|
+
if @prev && op == '-' && prev_chr !~ /\s/ &&
|
165
|
+
[:bool, :ident, :const].include?(@prev.type)
|
166
|
+
warn(<<END)
|
167
|
+
DEPRECATION WARNING:
|
168
|
+
On line #{@line}, character #{last_match_position}#{" of '#{@filename}'" if @filename}
|
169
|
+
- will be allowed as part of variable names in version 2.4.
|
170
|
+
Please add whitespace to separate it from the previous token.
|
171
|
+
END
|
172
|
+
end
|
173
|
+
|
162
174
|
[OPERATORS[op]]
|
163
175
|
end
|
164
176
|
|
data/lib/sass/script/parser.rb
CHANGED
@@ -14,7 +14,7 @@ module Sass
|
|
14
14
|
# Used for error reporting
|
15
15
|
def initialize(str, line, offset, filename = nil)
|
16
16
|
@filename = filename
|
17
|
-
@lexer = Lexer.new(str, line, offset)
|
17
|
+
@lexer = Lexer.new(str, line, offset, filename)
|
18
18
|
end
|
19
19
|
|
20
20
|
# Parses a SassScript expression within an interpolated segment (`#{}`).
|
data/test/sass/script_test.rb
CHANGED
@@ -61,22 +61,22 @@ foo \#{"\\\#{" + "baz"} bang
|
|
61
61
|
SASS
|
62
62
|
end
|
63
63
|
|
64
|
-
def
|
64
|
+
def test_implicit_string_warning
|
65
65
|
assert_warning(<<WARN) {eval("foo")}
|
66
66
|
DEPRECATION WARNING:
|
67
|
-
On line 1, character 1 of '
|
67
|
+
On line 1, character 1 of 'test_implicit_string_warning_inline.sass'
|
68
68
|
Implicit strings have been deprecated and will be removed in version 2.4.
|
69
69
|
'foo' was not quoted. Please add double quotes (e.g. "foo").
|
70
70
|
WARN
|
71
71
|
assert_warning(<<WARN) {eval("1 + foo")}
|
72
72
|
DEPRECATION WARNING:
|
73
|
-
On line 1, character 5 of '
|
73
|
+
On line 1, character 5 of 'test_implicit_string_warning_inline.sass'
|
74
74
|
Implicit strings have been deprecated and will be removed in version 2.4.
|
75
75
|
'foo' was not quoted. Please add double quotes (e.g. "foo").
|
76
76
|
WARN
|
77
77
|
assert_warning(<<WARN) {render("@if 1 + foo")}
|
78
78
|
DEPRECATION WARNING:
|
79
|
-
On line 1, character 9 of '
|
79
|
+
On line 1, character 9 of 'test_implicit_string_warning_inline.sass'
|
80
80
|
Implicit strings have been deprecated and will be removed in version 2.4.
|
81
81
|
'foo' was not quoted. Please add double quotes (e.g. "foo").
|
82
82
|
WARN
|
@@ -84,7 +84,7 @@ WARN
|
|
84
84
|
# Regression
|
85
85
|
assert_warning(<<WARN) {render("@if if")}
|
86
86
|
DEPRECATION WARNING:
|
87
|
-
On line 1, character 5 of '
|
87
|
+
On line 1, character 5 of 'test_implicit_string_warning_inline.sass'
|
88
88
|
Implicit strings have been deprecated and will be removed in version 2.4.
|
89
89
|
'if' was not quoted. Please add double quotes (e.g. "if").
|
90
90
|
WARN
|
@@ -102,6 +102,24 @@ WARN
|
|
102
102
|
assert_equal "public_instance_methods()", resolve("public_instance_methods()")
|
103
103
|
end
|
104
104
|
|
105
|
+
def test_hyphen_warning
|
106
|
+
a = Sass::Script::String.new("a")
|
107
|
+
b = Sass::Script::String.new("b")
|
108
|
+
assert_warning(<<WARN) {eval("!a-!b", {}, env("a" => a, "b" => b))}
|
109
|
+
DEPRECATION WARNING:
|
110
|
+
On line 1, character 3 of 'test_hyphen_warning_inline.sass'
|
111
|
+
- will be allowed as part of variable names in version 2.4.
|
112
|
+
Please add whitespace to separate it from the previous token.
|
113
|
+
WARN
|
114
|
+
|
115
|
+
assert_warning(<<WARN) {eval("true-false")}
|
116
|
+
DEPRECATION WARNING:
|
117
|
+
On line 1, character 5 of 'test_hyphen_warning_inline.sass'
|
118
|
+
- will be allowed as part of variable names in version 2.4.
|
119
|
+
Please add whitespace to separate it from the previous token.
|
120
|
+
WARN
|
121
|
+
end
|
122
|
+
|
105
123
|
def test_ruby_equality
|
106
124
|
assert_equal eval('"foo"'), eval('"foo"')
|
107
125
|
assert_equal eval('1'), eval('1.0')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: haml-edge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Weizenbaum
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-07-
|
13
|
+
date: 2009-07-11 00:00:00 -04:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -44,9 +44,9 @@ extensions: []
|
|
44
44
|
|
45
45
|
extra_rdoc_files:
|
46
46
|
- README.md
|
47
|
-
- REVISION
|
48
|
-
- MIT-LICENSE
|
49
47
|
- VERSION
|
48
|
+
- MIT-LICENSE
|
49
|
+
- REVISION
|
50
50
|
- VERSION_NAME
|
51
51
|
- EDGE_GEM_VERSION
|
52
52
|
files:
|
@@ -249,9 +249,9 @@ files:
|
|
249
249
|
- init.rb
|
250
250
|
- .yardopts
|
251
251
|
- README.md
|
252
|
-
- REVISION
|
253
|
-
- MIT-LICENSE
|
254
252
|
- VERSION
|
253
|
+
- MIT-LICENSE
|
254
|
+
- REVISION
|
255
255
|
- VERSION_NAME
|
256
256
|
- EDGE_GEM_VERSION
|
257
257
|
has_rdoc: true
|