22// https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027
33var commentre = / \/ \* [ ^ * ] * \* + ( [ ^ / * ] [ ^ * ] * \* + ) * \/ / g
44
5- function parse ( css , options ) {
5+ function parse ( css , options ) { // eslint-disable-line no-unused-vars
66 options = options || { } ;
77
88 /**
@@ -28,7 +28,7 @@ function parse(css, options){
2828 */
2929
3030 function position ( ) {
31- var start = { line : lineno , column : column } ;
31+ // var start = { line: lineno, column: column };
3232 return function ( node ) {
3333 //node.position = new Position(start);
3434 whitespace ( ) ;
@@ -151,8 +151,8 @@ function parse(css, options){
151151
152152 function comments ( rules ) {
153153 var c ;
154- rules = rules || [ ] ;
155- while ( c = comment ( ) ) {
154+ rules = ( rules || [ ] ) ;
155+ while ( ( c = comment ( ) ) ) {
156156 if ( c !== false ) {
157157 //rules.push(c);
158158 }
@@ -216,15 +216,15 @@ function parse(css, options){
216216 var pos = position ( ) ;
217217
218218 // prop
219- var prop = match ( / ^ ( \* ? [ - # \/ \* \\ \w ] + ( \[ [ 0 - 9 a - z _ - ] + \] ) ? ) \s * / ) ;
219+ var prop = match ( / ^ ( \* ? [ - # \/ \* \\ \w ] + ( \[ [ 0 - 9 a - z _ - ] + \] ) ? ) \s * / ) ; // eslint-disable-line no-useless-escape
220220 if ( ! prop ) return ;
221221 prop = trim ( prop [ 0 ] ) ;
222222
223223 // :
224224 if ( ! match ( / ^ : \s * / ) ) return error ( "property missing ':'" ) ;
225225
226226 // val
227- var val = match ( / ^ ( (?: ' (?: \\ ' | .) * ?' | " (?: \\ " | .) * ?" | \( [ ^ \) ] * ?\) | [ ^ } ; ] ) + ) / ) ;
227+ var val = match ( / ^ ( (?: ' (?: \\ ' | .) * ?' | " (?: \\ " | .) * ?" | \( [ ^ \) ] * ?\) | [ ^ } ; ] ) + ) / ) ; // eslint-disable-line no-useless-escape
228228
229229 var ret = pos ( {
230230 type : 'declaration' ,
@@ -250,10 +250,10 @@ function parse(css, options){
250250
251251 // declarations
252252 var decl ;
253- while ( decl = declaration ( ) ) {
253+ while ( ( decl = declaration ( ) ) ) {
254254 if ( decl !== false ) {
255- decls . push ( decl ) ;
256- comments ( decls ) ;
255+ decls . push ( decl ) ;
256+ comments ( decls ) ;
257257 }
258258 }
259259
@@ -270,7 +270,7 @@ function parse(css, options){
270270 var vals = [ ] ;
271271 var pos = position ( ) ;
272272
273- while ( m = match ( / ^ ( ( \d + \. \d + | \. \d + | \d + ) % ? | [ a - z ] + ) \s * / ) ) {
273+ while ( ( m = match ( / ^ ( ( \d + \. \d + | \. \d + | \d + ) % ? | [ a - z ] + ) \s * / ) ) ) {
274274 vals . push ( m [ 1 ] ) ;
275275 match ( / ^ , \s * / ) ;
276276 }
@@ -296,15 +296,15 @@ function parse(css, options){
296296 var vendor = m [ 1 ] ;
297297
298298 // identifier
299- var m = match ( / ^ ( [ - \w ] + ) \s * / ) ;
299+ m = match ( / ^ ( [ - \w ] + ) \s * / ) ;
300300 if ( ! m ) return error ( "@keyframes missing name" ) ;
301301 var name = m [ 1 ] ;
302302
303303 if ( ! open ( ) ) return error ( "@keyframes missing '{'" ) ;
304304
305305 var frame ;
306306 var frames = comments ( ) ;
307- while ( frame = keyframe ( ) ) {
307+ while ( ( frame = keyframe ( ) ) ) {
308308 frames . push ( frame ) ;
309309 frames = frames . concat ( comments ( ) ) ;
310310 }
@@ -422,7 +422,7 @@ function parse(css, options){
422422
423423 // declarations
424424 var decl ;
425- while ( decl = declaration ( ) ) {
425+ while ( ( decl = declaration ( ) ) ) {
426426 decls . push ( decl ) ;
427427 decls = decls . concat ( comments ( ) ) ;
428428 }
@@ -476,7 +476,7 @@ function parse(css, options){
476476
477477 // declarations
478478 var decl ;
479- while ( decl = declaration ( ) ) {
479+ while ( ( decl = declaration ( ) ) ) {
480480 decls . push ( decl ) ;
481481 decls = decls . concat ( comments ( ) ) ;
482482 }
0 commit comments