Zone parser should return all errors instead of just the first one and provide context
#1.095 geöffnet am 26.07.2025
Repository-Metriken
- Stars
- (1.958 Sterne)
- PR-Merge-Metriken
- (PR-Metriken ausstehend)
Beschreibung
parse_zones() will call Scene::parse_from_zone() for each line in the provided zones file. However, when Scene::parse_from_zone() encounters a validation error, it immediately returns without evaluating the rest of the parameters. parse_zones() will also bubble up that error immediately as well. This leads to the user debugging a malformed zones file input error-by-error, which is a cumbersome task if the zones file has more than a handful of invalid values.
Instead, Scene::parse_from_zone() should greedily evaluate all inputs in the line and compile all the validation errors and return them in bulk. parse_zones() will further compile these for all lines and finally return the full list of validation errors. Warnings should be similarly compiled and returned with the Ok value. We could use a Tuple like (OK_VALUE,Option<Vec<ValidationWarning>>).
Additionally, in order to help the user quickly find the offending line(s), we should attach context like the line number and/or the start/end frame index so they know where to debug their zones file.
Thank you, - Boats M.