@@ -109,10 +109,10 @@ private function parseListItem(CSSList $oList, $bIsRoot = false) {
109109 $ oAtRule = $ this ->parseAtRule ();
110110 if ($ oAtRule instanceof Charset) {
111111 if (!$ bIsRoot ) {
112- throw new UnexpectedTokenException ('@charset may only occur in root document ' , '' , 'custom ' );
112+ throw new UnexpectedTokenException ('@charset may only occur in root document ' , '' , 'custom ' , $ this -> iLineNum );
113113 }
114114 if (count ($ oList ->getContents ()) > 0 ) {
115- throw new UnexpectedTokenException ('@charset must be the first parseable token in a document ' , '' , 'custom ' );
115+ throw new UnexpectedTokenException ('@charset must be the first parseable token in a document ' , '' , 'custom ' , $ this -> iLineNum );
116116 }
117117 $ this ->setCharset ($ oAtRule ->getCharset ()->getString ());
118118 }
@@ -164,10 +164,10 @@ private function parseAtRule() {
164164 }
165165 $ this ->consume ('; ' );
166166 if ($ sPrefix !== null && !is_string ($ sPrefix )) {
167- throw new UnexpectedTokenException ('Wrong namespace prefix ' , $ sPrefix , 'custom ' );
167+ throw new UnexpectedTokenException ('Wrong namespace prefix ' , $ sPrefix , 'custom ' , $ iIdentifierLineNum );
168168 }
169169 if (!($ mUrl instanceof CSSString || $ mUrl instanceof URL )) {
170- throw new UnexpectedTokenException ('Wrong namespace url of invalid type ' , $ mUrl , 'custom ' );
170+ throw new UnexpectedTokenException ('Wrong namespace url of invalid type ' , $ mUrl , 'custom ' , $ iIdentifierLineNum );
171171 }
172172 return new CSSNamespace ($ mUrl , $ sPrefix , $ iIdentifierLineNum );
173173 } else {
@@ -195,7 +195,7 @@ private function parseAtRule() {
195195 private function parseIdentifier ($ bAllowFunctions = true , $ bIgnoreCase = true ) {
196196 $ sResult = $ this ->parseCharacter (true );
197197 if ($ sResult === null ) {
198- throw new UnexpectedTokenException ($ sResult , $ this ->peek (5 ), 'identifier ' );
198+ throw new UnexpectedTokenException ($ sResult , $ this ->peek (5 ), 'identifier ' , $ this -> iLineNum );
199199 }
200200 $ sCharacter = null ;
201201 while (($ sCharacter = $ this ->parseCharacter (true )) !== null ) {
@@ -522,14 +522,14 @@ private function consume($mValue = 1) {
522522 $ iLineCount = substr_count ($ mValue , "\n" );
523523 $ iLength = $ this ->strlen ($ mValue );
524524 if (!$ this ->streql ($ this ->substr ($ this ->iCurrentPosition , $ iLength ), $ mValue )) {
525- throw new UnexpectedTokenException ($ mValue , $ this ->peek (max ($ iLength , 5 )));
525+ throw new UnexpectedTokenException ($ mValue , $ this ->peek (max ($ iLength , 5 )), $ this -> iLineNum );
526526 }
527527 $ this ->iLineNum += $ iLineCount ;
528528 $ this ->iCurrentPosition += $ this ->strlen ($ mValue );
529529 return $ mValue ;
530530 } else {
531531 if ($ this ->iCurrentPosition + $ mValue > $ this ->iLength ) {
532- throw new UnexpectedTokenException ($ mValue , $ this ->peek (5 ), 'count ' );
532+ throw new UnexpectedTokenException ($ mValue , $ this ->peek (5 ), 'count ' , $ this -> iLineNum );
533533 }
534534 $ sResult = $ this ->substr ($ this ->iCurrentPosition , $ mValue );
535535 $ iLineCount = substr_count ($ sResult , "\n" );
@@ -544,7 +544,7 @@ private function consumeExpression($mExpression) {
544544 if (preg_match ($ mExpression , $ this ->inputLeft (), $ aMatches , PREG_OFFSET_CAPTURE ) === 1 ) {
545545 return $ this ->consume ($ aMatches [0 ][0 ]);
546546 }
547- throw new UnexpectedTokenException ($ mExpression , $ this ->peek (5 ), 'expression ' );
547+ throw new UnexpectedTokenException ($ mExpression , $ this ->peek (5 ), 'expression ' , $ this -> iLineNum );
548548 }
549549
550550 private function consumeWhiteSpace () {
@@ -602,7 +602,7 @@ private function consumeUntil($aEnd, $bIncludeEnd = false, $consumeEnd = false)
602602 }
603603
604604 $ this ->iCurrentPosition = $ start ;
605- throw new UnexpectedTokenException ('One of (" ' .implode ('"," ' , $ aEnd ).'") ' , $ this ->peek (5 ), 'search ' );
605+ throw new UnexpectedTokenException ('One of (" ' .implode ('"," ' , $ aEnd ).'") ' , $ this ->peek (5 ), 'search ' , $ this -> iLineNum );
606606 }
607607
608608 private function inputLeft () {
0 commit comments