def parse_directive_locations(lexer: Lexer) -> List[NameNode]:
    """DirectiveLocations"""
    # optional leading pipe
    expect_optional_token(lexer, TokenKind.PIPE)
    locations: List[NameNode] = []
    append = locations.append
    while True:
        append(parse_directive_location(lexer))
        if not expect_optional_token(lexer, TokenKind.PIPE):
            break
    return locations
DirectiveLocations