Latte\Compiler::processComment PHP Method

processComment() private method

private processComment ( latte\Token $token )
$token latte\Token
    private function processComment(Token $token)
    {
        $leftOfs = ($tmp = strrpos($this->output, "\n")) === FALSE ? 0 : $tmp + 1;
        $isLeftmost = trim(substr($this->output, $leftOfs)) === '';
        $isRightmost = substr($token->text, -1) === "\n";
        if ($isLeftmost && $isRightmost) {
            $this->output = substr($this->output, 0, $leftOfs);
        } else {
            $this->output .= substr($token->text, strlen(rtrim($token->text, "\n")));
        }
    }