コード例 #1
0
ファイル: SelectorToken.class.php プロジェクト: ranklau/Fl
 /**
  * 
  * get such as :hover token
  * @param string $char
  */
 public function getPseudoClassToken($char)
 {
     $result = $char;
     $this->getNextChar();
     $parenthesesNum = 0;
     while (!$this->isEof()) {
         $char = $this->getCurrentChar();
         if ($parenthesesNum === 0 && Fl_Css_Static::isSelectorCharUtil($char)) {
             break;
         } else {
             if ($char === '(') {
                 $parenthesesNum++;
             } else {
                 if ($char === ')') {
                     $parenthesesNum--;
                 } else {
                     if ($char === '"' || $char === "'") {
                         $char = $this->getQuoteText($char, true, true);
                     }
                 }
             }
         }
         $result .= $char;
         if (!$this->pendingNextChar) {
             $this->getNextChar();
         } else {
             $this->pendingNextChar = false;
         }
     }
     if ($parenthesesNum !== 0) {
         $this->throwException('get Pseudo Class error');
     }
     return $result;
 }