Wrangling diagnostics is a common concern in the parsers and evaluator, and these helper functions are intended to make that code more concise.