Currently it's possible to have `prefixPos !== null` yet `suffixPos === null` -- what should this code do in that case?  (Right now I assume it'd just crash inside posWithinRange()).