def overlap
bend-kit-router@0.2.0.0 · router.bend:422
import bend-kit-router@0.2.0.0/router.bend as Router
import Base
422def overlap(a: List<&2, Segment>, b: List<&2, Segment>) -> Bool:
423 match a b:
424 case Nil{} Nil{}:
425 True{}
426 case Literal{x} <> at Literal{y} <> bt:
427 continue(String.eq(x, y), u => overlap(at, bt))
428 case Literal{x} <> at Parameter{y} <> bt:
429 continue(Bool.not(String.is_empty(x)), u => overlap(at, bt))
430 case Parameter{x} <> at Literal{y} <> bt:
431 continue(Bool.not(String.is_empty(y)), u => overlap(at, bt))
432 case Parameter{x} <> at Parameter{y} <> bt:
433 overlap(at, bt)
434 case _ _:
435 False{}