pub fn path_index(base: &[PathElement], index: usize) -> Vec<PathElement>
Helper: extend a path with an index.