コード例 #1
0
ファイル: munger.php プロジェクト: mvonballmo/earthli-webcore
 /**
  * Replace a known tag with its actual content.
  * @param MUNGER_TOKEN $token
  * @return string
  * @access private
  */
 protected function _known_tag_as_text($token)
 {
     return $token->data();
 }
コード例 #2
0
 /**
  * Track the line number and column in the text.
  * @param MUNGER_TOKEN $token
  * @access private
  */
 protected function _update_position($token)
 {
     $text = $token->data();
     $pos = strpos($text, "\n");
     if ($pos !== false) {
         $last_pos = $pos + 1;
         while ($pos !== false) {
             $this->_line_number += 1;
             $this->_column = 1;
             $pos = strpos($text, "\n", $last_pos);
             if ($pos !== false) {
                 $last_pos = $pos + 1;
             }
         }
         $this->_column += strlen($text) - $last_pos;
     } else {
         $this->_column += strlen($text);
     }
 }
コード例 #3
0
 /** Transform a token as text.
  * @param MUNGER_TOKEN $token
  * @access private */
 protected function _transform_as_text($token)
 {
     $this->_output .= $token->data();
 }