boostorg/spirit_x4
The domain of integral bounds given to `repeat_directive` is underspecified
Aperta
#62 aperta il 5 ott 2025
documentationenhancementgood first issuehelp wanted
Metriche repository
- Star
- (37 stelle)
- Metriche merge PR
- (Nessuna PR mergiata in 30 g)
Descrizione
Perhaps this should be both rejected in the code and described in the new documentation.
- The documentation should note that
repeatoperates on closed bounds. x4::repeat(negative)should be rejectedx4::repat(negative, ...)andx4::repat(..., negative)should be rejectedx4::repeat(max, min)should be rejectedx4::repeat(0)should be rejected- This is semantically very vague.
- As of now, I confirmed that it actually results in always succeeding parser (regardless of the underlying parser
pgiven torepeat(0)[p]), similar toeps
Proposed solution:
- The basic concept should be changed from
std::integraltostd::unsigned_integral x4::repeat(max, min)should throw std::domain_errorx4::repeat(0)should throw std::domain_error