/** * 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(); }
/** * 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); } }
/** Transform a token as text. * @param MUNGER_TOKEN $token * @access private */ protected function _transform_as_text($token) { $this->_output .= $token->data(); }