public static function unexpectedCharacter(Input $definition, array $expected = []): self
    {
        $pointer = self::createPointerString($definition->getInput(), $definition->getIndex());

        if (empty($expected)) {
            return new self("Unexpected character:\n$pointer");
        }

        $expected = $expected ?? $definition->getLatestExpectations();

        $expected = array_map(function (string $e) {
            return "'$e'";
        }, $expected);

        $expected = implode(", ", $expected);

        return new self("Unexpected character (expected $expected):\n$pointer");
    }