Skip to content

list parser (%) should not omit the RHS if the attribute of delimiter is not an unused_type #70

@saki7

Description

@saki7

Currently the L53 of list parser passes the hard-coded unused attribute for the underlying parser. This leads to surprising result at runtime, where the content of the RHS is silently omitted even if the RHS has some explicit attribute.

if (!detail::parse_into_container(this->left, first, last, ctx, x4::assume_container(attr))) {
return false;
}
It last_parse_it = first;
while (
this->right.parse(last_parse_it, last, ctx, unused) &&
detail::parse_into_container(this->left, last_parse_it, last, ctx, x4::assume_container(attr))
) {

This looks like a bug to me, but fixing this would be a breaking change. We should re-check the unit tests.

A workaround is to rewrite this:

body % delim

to this:

body >> *(delim >> body)

but I think the current behavior is very awkward in the first place.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtests neededUnit tests are required for all public API

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions