@@ -331,7 +331,7 @@ impl<'i, 't> Parser<'i, 't> {
331
331
/// This can help tell e.g. `color: green;` from `color: green 4px;`
332
332
#[ inline]
333
333
pub fn parse_entirely < F , T > ( & mut self , parse : F ) -> Result < T , ( ) >
334
- where F : FnOnce ( & mut Parser ) -> Result < T , ( ) > {
334
+ where F : FnOnce ( & mut Parser < ' i , ' t > ) -> Result < T , ( ) > {
335
335
let result = parse ( self ) ;
336
336
try!( self . expect_exhausted ( ) ) ;
337
337
result
@@ -374,7 +374,9 @@ impl<'i, 't> Parser<'i, 't> {
374
374
/// The result is overridden to `Err(())` if the closure leaves some input before that point.
375
375
#[ inline]
376
376
pub fn parse_nested_block < F , T > ( & mut self , parse : F ) -> Result < T , ( ) >
377
- where F : FnOnce ( & mut Parser ) -> Result < T , ( ) > {
377
+ where for < ' tt > F : FnOnce ( & mut Parser < ' i , ' tt > ) -> Result < T , ( ) > {
378
+ // where 'tt: 't, F: FnOnce(&mut Parser<'i, 'tt>) -> Result<T, ()> {
379
+ // where F: FnOnce(&mut Parser) -> Result<T, ()> {
378
380
let block_type = self . at_start_of . take ( ) . expect ( "\
379
381
A nested parser can only be created when a Function, \
380
382
ParenthesisBlock, SquareBracketBlock, or CurlyBracketBlock \
@@ -412,7 +414,7 @@ impl<'i, 't> Parser<'i, 't> {
412
414
#[ inline]
413
415
pub fn parse_until_before < F , T > ( & mut self , delimiters : Delimiters , parse : F )
414
416
-> Result < T , ( ) >
415
- where F : FnOnce ( & mut Parser ) -> Result < T , ( ) > {
417
+ where for < ' tt > F : FnOnce ( & mut Parser < ' i , ' tt > ) -> Result < T , ( ) > {
416
418
let delimiters = self . stop_before | delimiters;
417
419
let result;
418
420
// Introduce a new scope to limit duration of nested_parser’s borrow
@@ -451,7 +453,7 @@ impl<'i, 't> Parser<'i, 't> {
451
453
#[ inline]
452
454
pub fn parse_until_after < F , T > ( & mut self , delimiters : Delimiters , parse : F )
453
455
-> Result < T , ( ) >
454
- where F : FnOnce ( & mut Parser ) -> Result < T , ( ) > {
456
+ where for < ' tt > F : FnOnce ( & mut Parser < ' i , ' tt > ) -> Result < T , ( ) > {
455
457
let result = self . parse_until_before ( delimiters, parse) ;
456
458
let next_byte = self . tokenizer . next_byte ( ) ;
457
459
if next_byte. is_some ( ) && !self . stop_before . contains ( Delimiters :: from_byte ( next_byte) ) {
@@ -481,7 +483,7 @@ impl<'i, 't> Parser<'i, 't> {
481
483
482
484
/// Parse a <ident-token> whose unescaped value is an ASCII-insensitive match for the given value.
483
485
#[ inline]
484
- pub fn expect_ident_matching < ' a > ( & mut self , expected_value : & str ) -> Result < ( ) , ( ) > {
486
+ pub fn expect_ident_matching ( & mut self , expected_value : & str ) -> Result < ( ) , ( ) > {
485
487
match try!( self . next ( ) ) {
486
488
Token :: Ident ( ref value) if value. eq_ignore_ascii_case ( expected_value) => Ok ( ( ) ) ,
487
489
_ => Err ( ( ) )
@@ -512,9 +514,9 @@ impl<'i, 't> Parser<'i, 't> {
512
514
pub fn expect_url ( & mut self ) -> Result < Cow < ' i , str > , ( ) > {
513
515
match try!( self . next ( ) ) {
514
516
Token :: UnquotedUrl ( value) => Ok ( value) ,
515
- Token :: Function ( ref name) if name. eq_ignore_ascii_case ( "url" ) => {
516
- self . parse_nested_block ( |input| input. expect_string ( ) )
517
- } ,
517
+ // Token::Function(ref name) if name.eq_ignore_ascii_case("url") => {
518
+ // self.parse_nested_block(|input| input.expect_string())
519
+ // },
518
520
_ => Err ( ( ) )
519
521
}
520
522
}
@@ -525,9 +527,9 @@ impl<'i, 't> Parser<'i, 't> {
525
527
match try!( self . next ( ) ) {
526
528
Token :: UnquotedUrl ( value) => Ok ( value) ,
527
529
Token :: QuotedString ( value) => Ok ( value) ,
528
- Token :: Function ( ref name) if name. eq_ignore_ascii_case ( "url" ) => {
529
- self . parse_nested_block ( |input| input. expect_string ( ) )
530
- } ,
530
+ // Token::Function(ref name) if name.eq_ignore_ascii_case("url") => {
531
+ // self.parse_nested_block(|input| input.expect_string())
532
+ // },
531
533
_ => Err ( ( ) )
532
534
}
533
535
}
0 commit comments