@@ -31,7 +31,6 @@ class Parser {
31
31
private $ oParserSettings ;
32
32
private $ sCharset ;
33
33
private $ iLength ;
34
- private $ peekCache = null ;
35
34
private $ blockRules ;
36
35
private $ aSizeUnits ;
37
36
@@ -290,7 +289,6 @@ private function parseRuleSet($oRuleSet) {
290
289
// We need to “unfind” the matches to the end of the ruleSet as this will be matched later
291
290
if ($ this ->streql (substr ($ sConsume , -1 ), '} ' )) {
292
291
--$ this ->iCurrentPosition ;
293
- $ this ->peekCache = null ;
294
292
} else {
295
293
$ this ->consumeWhiteSpace ();
296
294
while ($ this ->comes ('; ' )) {
@@ -488,19 +486,12 @@ private function comes($sString, $bCaseInsensitive = false) {
488
486
}
489
487
490
488
private function peek ($ iLength = 1 , $ iOffset = 0 ) {
491
- if (($ peek = (!$ iOffset && ($ iLength === 1 ))) &&
492
- !is_null ($ this ->peekCache )) {
493
- return $ this ->peekCache ;
494
- }
495
489
$ iOffset += $ this ->iCurrentPosition ;
496
490
if ($ iOffset >= $ this ->iLength ) {
497
491
return '' ;
498
492
}
499
493
$ iLength = min ($ iLength , $ this ->iLength -$ iOffset );
500
494
$ out = $ this ->substr ($ iOffset , $ iLength );
501
- if ($ peek ) {
502
- $ this ->peekCache = $ out ;
503
- }
504
495
return $ out ;
505
496
}
506
497
@@ -511,15 +502,13 @@ private function consume($mValue = 1) {
511
502
throw new UnexpectedTokenException ($ mValue , $ this ->peek (max ($ iLength , 5 )));
512
503
}
513
504
$ this ->iCurrentPosition += $ this ->strlen ($ mValue );
514
- $ this ->peekCache = null ;
515
505
return $ mValue ;
516
506
} else {
517
507
if ($ this ->iCurrentPosition + $ mValue > $ this ->iLength ) {
518
508
throw new UnexpectedTokenException ($ mValue , $ this ->peek (5 ), 'count ' );
519
509
}
520
510
$ sResult = $ this ->substr ($ this ->iCurrentPosition , $ mValue );
521
511
$ this ->iCurrentPosition += $ mValue ;
522
- $ this ->peekCache = null ;
523
512
return $ sResult ;
524
513
}
525
514
}
0 commit comments