let pos_or_undef = function
  | None -> undefined_position
  | Some x -> x