private function parseAttributeName(Input $definition): string
    {
        $maxLength = self::MAX_ATTRIBUTE_NAME_LENGTH;

        $name = $definition->takeAllAlphaNumUntil(":}");

        if (empty($name)) {
            throw InvalidRoute::emptyAttributeName($definition);
        }

        if (strlen($name) > $maxLength) {
            throw InvalidRoute::longAttributeName($definition, $maxLength);
        }

        return $name;
    }