def path.norm.pop
import bend-kit-files@0.3.1.0/files.bend as Filesimport Base
38# A ".." above the root is dropped; above a relative start it is kept.
39def path.norm.pop(stack: List<&2, String>, abs: Bool) -> List<&2, String>:
40 match stack:
41 case Nil{}:
42 Bool.pick(List<&2, String>, abs, Nil{}, [".."])
43 case Con{+h, t}:
44 path.norm.pop.if(String.eq(h, ".."), h, t)