@@ -109,10 +109,10 @@ private function parseListItem(CSSList $oList, $bIsRoot = false) {
109
109
$ oAtRule = $ this ->parseAtRule ();
110
110
if ($ oAtRule instanceof Charset) {
111
111
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 );
113
113
}
114
114
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 );
116
116
}
117
117
$ this ->setCharset ($ oAtRule ->getCharset ()->getString ());
118
118
}
@@ -164,10 +164,10 @@ private function parseAtRule() {
164
164
}
165
165
$ this ->consume ('; ' );
166
166
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 );
168
168
}
169
169
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 );
171
171
}
172
172
return new CSSNamespace ($ mUrl , $ sPrefix , $ iIdentifierLineNum );
173
173
} else {
@@ -195,7 +195,7 @@ private function parseAtRule() {
195
195
private function parseIdentifier ($ bAllowFunctions = true , $ bIgnoreCase = true ) {
196
196
$ sResult = $ this ->parseCharacter (true );
197
197
if ($ sResult === null ) {
198
- throw new UnexpectedTokenException ($ sResult , $ this ->peek (5 ), 'identifier ' );
198
+ throw new UnexpectedTokenException ($ sResult , $ this ->peek (5 ), 'identifier ' , $ this -> iLineNum );
199
199
}
200
200
$ sCharacter = null ;
201
201
while (($ sCharacter = $ this ->parseCharacter (true )) !== null ) {
@@ -522,14 +522,14 @@ private function consume($mValue = 1) {
522
522
$ iLineCount = substr_count ($ mValue , "\n" );
523
523
$ iLength = $ this ->strlen ($ mValue );
524
524
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 );
526
526
}
527
527
$ this ->iLineNum += $ iLineCount ;
528
528
$ this ->iCurrentPosition += $ this ->strlen ($ mValue );
529
529
return $ mValue ;
530
530
} else {
531
531
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 );
533
533
}
534
534
$ sResult = $ this ->substr ($ this ->iCurrentPosition , $ mValue );
535
535
$ iLineCount = substr_count ($ sResult , "\n" );
@@ -544,7 +544,7 @@ private function consumeExpression($mExpression) {
544
544
if (preg_match ($ mExpression , $ this ->inputLeft (), $ aMatches , PREG_OFFSET_CAPTURE ) === 1 ) {
545
545
return $ this ->consume ($ aMatches [0 ][0 ]);
546
546
}
547
- throw new UnexpectedTokenException ($ mExpression , $ this ->peek (5 ), 'expression ' );
547
+ throw new UnexpectedTokenException ($ mExpression , $ this ->peek (5 ), 'expression ' , $ this -> iLineNum );
548
548
}
549
549
550
550
private function consumeWhiteSpace () {
@@ -602,7 +602,7 @@ private function consumeUntil($aEnd, $bIncludeEnd = false, $consumeEnd = false)
602
602
}
603
603
604
604
$ 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 );
606
606
}
607
607
608
608
private function inputLeft () {
0 commit comments