This repository was archived by the owner on Sep 23, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -519,22 +519,21 @@ private function peek($iLength = 1, $iOffset = 0) {
519519
520520 private function consume ($ mValue = 1 ) {
521521 if (is_string ($ mValue )) {
522- $ noLines = substr_count ($ mValue , "\n" );
522+ $ iLineCount = substr_count ($ mValue , "\n" );
523523 $ iLength = $ this ->strlen ($ mValue );
524524 if (!$ this ->streql ($ this ->substr ($ this ->iCurrentPosition , $ iLength ), $ mValue )) {
525525 throw new UnexpectedTokenException ($ mValue , $ this ->peek (max ($ iLength , 5 )));
526526 }
527- $ this ->iLineNum += $ noLines ;
527+ $ this ->iLineNum += $ iLineCount ;
528528 $ this ->iCurrentPosition += $ this ->strlen ($ mValue );
529529 return $ mValue ;
530530 } else {
531- $ substring = $ this ->substr ($ this ->iCurrentPosition , $ mValue );
532- $ noLines = substr_count ($ substring , "\n" );
533- $ this ->iLineNum += $ noLines ;
534531 if ($ this ->iCurrentPosition + $ mValue > $ this ->iLength ) {
535532 throw new UnexpectedTokenException ($ mValue , $ this ->peek (5 ), 'count ' );
536533 }
537534 $ sResult = $ this ->substr ($ this ->iCurrentPosition , $ mValue );
535+ $ iLineCount = substr_count ($ sResult , "\n" );
536+ $ this ->iLineNum += $ iLineCount ;
538537 $ this ->iCurrentPosition += $ mValue ;
539538 return $ sResult ;
540539 }
You can’t perform that action at this time.
0 commit comments