public static function offset(array $tokens, $index)
    {
        if (count($tokens) < 1) {
            return 0;
        }

        if (null === $index) {
            $index = count($tokens) - 1;
        }

        $source = '';

        for ($i = 0; $i < $index; ++$i) {
            $source .= $tokens[$i]->content();
        }

        return strlen($source);
    }