protected function consume($length = null)
    {

        if ($length === null) {

            if ($this->lastPeekResult === null)
                $this->throwException(
                    "Failed to consume: Nothing has been peeked and you"
                    ." didnt pass a length to consume"
                );

            $length = $this->strlen($this->lastPeekResult);
        }

        $this->input = $this->substr($this->input, $length);
        $this->position += $length;
        $this->offset += $length;

        return $this;
    }