File tree Expand file tree Collapse file tree 1 file changed +20
-7
lines changed Expand file tree Collapse file tree 1 file changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,22 @@ module.exports = function(css){
15
15
return { stylesheet : { rules : rules ( ) } } ;
16
16
}
17
17
18
+ /**
19
+ * Opening brace.
20
+ */
21
+
22
+ function open ( ) {
23
+ return match ( / ^ { \s * / ) ;
24
+ }
25
+
26
+ /**
27
+ * Closing brace.
28
+ */
29
+
30
+ function close ( ) {
31
+ return match ( / ^ } \s * / ) ;
32
+ }
33
+
18
34
/**
19
35
* Parse ruleset.
20
36
*/
@@ -143,7 +159,7 @@ module.exports = function(css){
143
159
var name = m [ 1 ] ;
144
160
145
161
// {
146
- if ( ! match ( / ^ { \s * / ) ) return ;
162
+ if ( ! open ( ) ) return ;
147
163
comments ( ) ;
148
164
149
165
var frame ;
@@ -153,8 +169,7 @@ module.exports = function(css){
153
169
comments ( ) ;
154
170
}
155
171
156
- // }
157
- if ( ! match ( / ^ } \s * / ) ) return ;
172
+ if ( ! close ( ) ) return ;
158
173
159
174
return {
160
175
name : name ,
@@ -201,8 +216,7 @@ module.exports = function(css){
201
216
function declarations ( ) {
202
217
var decls = [ ] ;
203
218
204
- // {
205
- if ( ! match ( / ^ { \s * / ) ) return ;
219
+ if ( ! open ( ) ) return ;
206
220
comments ( ) ;
207
221
208
222
// declarations
@@ -212,8 +226,7 @@ module.exports = function(css){
212
226
comments ( ) ;
213
227
}
214
228
215
- // }
216
- if ( ! match ( / ^ } \s * / ) ) return ;
229
+ if ( ! close ( ) ) return ;
217
230
return decls ;
218
231
}
219
232
You can’t perform that action at this time.
0 commit comments