improved parse diag
improved support for source ranges for diag