Add ~x.y.z and ^x.y.z parsing

I think it would be good to have a vaguely standalone description (or at least a summary) here.