コード例 #1
0
ファイル: Ast.class.php プロジェクト: liuguanyu/Fl
 /**
  * 
  * tag start statement
  */
 public function tagStartStatement()
 {
     $token = $this->currentToken;
     $tag = strtolower(Fl_Html_Static::getTagName($token['value'], $this));
     if (Fl_Html_Static::isSingleTag($tag)) {
         return array("type" => FL_TOKEN_HTML_SINGLE_TAG, "value" => $this->getValue($token));
     }
     $result = array();
     $this->inTags[] = $tag;
     $comment = array();
     while ($this->currentToken) {
         $this->getNextToken();
         if (Fl_Html_Static::isTag($this->currentToken)) {
             if (Fl_Html_Static::optionalTagUntil($tag, $this->currentToken, $this)) {
                 $this->peekToken = $this->currentToken;
                 if ($this->currentToken['type'] === FL_TOKEN_HTML_TAG_END) {
                     $tagEnd = $this->currentToken;
                     if ($tag === Fl_Html_Static::getTagName($this->currentToken['value'], $this)) {
                         $this->getNextToken();
                     }
                 }
                 break;
             }
         }
         $re = $this->statement();
         if ($re) {
             $result[] = $re;
         }
     }
     array_pop($this->inTags);
     return array("type" => FL_TOKEN_HTML_TAG, "tag" => $tag, "value" => $this->getValue($token), "children" => $result, "end" => $this->getValue($tagEnd));
 }