function _parsePasswordRequiredOrAllowedPropertyValue()

in tools/PasswordRulesParser.js [355:401]


function _parsePasswordRequiredOrAllowedPropertyValue(input, position)
{
    console.assert(position >= 0);
    console.assert(position < input.length);

    let length = input.length;
    let propertyValues = [];
    while (true) {
        if (_isIdentifierCharacter(input[position])) {
            let identifierStartPosition = position;
            var [propertyValue, position] = _parseIdentifier(input, position);
            if (!_isValidRequiredOrAllowedPropertyValueIdentifier(propertyValue)) {
                console.error("Unrecognized property value identifier: " + propertyValue);
                return [null, identifierStartPosition];
            }
            propertyValues.push(new NamedCharacterClass(propertyValue));
        }
        else if (input[position] == CHARACTER_CLASS_START_SENTINEL) {
            var [propertyValue, position] = _parseCustomCharacterClass(input, position);
            if (propertyValue && propertyValue.length) {
                propertyValues.push(new CustomCharacterClass(propertyValue));
            }
        }
        else {
            console.error("Failed to find start of property value: " + input.substr(position));
            return [null, position];
        }

        position = _indexOfNonWhitespaceCharacter(input, position);
        if (position >= length || input[position] === PROPERTY_SEPARATOR) {
            break;
        }

        if (input[position] === PROPERTY_VALUE_SEPARATOR) {
            position = _indexOfNonWhitespaceCharacter(input, position + 1);
            if (position >= length) {
                console.error("Found end-of-line instead of start of next property value");
                return [null, position];
            }
            continue;
        }

        console.error("Failed to find start of next property or property value: " + input.substr(position));
        return [null, position];
    }
    return [propertyValues, position];
}