Calculate parent line number

cc @osheroff