labels: implement parse_delta_labels

Convenience function for parsing a series of delta labels; add tests as well.
This commit is contained in:
Dirk-Jan C. Binnema
2025-08-27 08:34:16 +03:00
committed by Seth Ladygo
parent ee42d90b51
commit d07a5bc2c1
2 changed files with 56 additions and 2 deletions

View File

@ -46,6 +46,18 @@ using DeltaLabelVec = std::vector<DeltaLabel>;
*/
Result<DeltaLabel> parse_delta_label(const std::string& expr);
/**
* Parse a series of label expressions, with some separator
*
* This also validates the labels, as per valid_label()
*
* @param exprs label expressions
*
* @return a result with either a DeltaLabel or an error
*/
Result<DeltaLabelVec> parse_delta_labels(const std::string& exprs,
const std::string sepa);
/**
* Is the label (without +/- prefix) valid?
*