rust-av/Av1an

Zone parser should return all errors instead of just the first one and provide context

Open

#1,095 opened on Jul 26, 2025

 (0 comments) (0 reactions) (0 assignees)Rust (188 forks)auto 404
enhancementgood first issue

Repository metrics

Stars
 (1,958 stars)
PR merge metrics
 (PR metrics pending)

Description

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.

Contributor guide