Skip to content

Positional arguments within repeatable group are blocked in 2nd iteration #79

@Ext3h

Description

@Ext3h

Consider the following grammar:

repeatable(
	required("--begin-group-a")
	&
	(
		option("--conflicting-group-option")
	)
)
|
repeatable(
	required("--begin-group-b")
	&
	(
		option("--conflicting-group-option")
	)
)

When trying to parse any of --begin-group-a --begin-group-a, --begin-group-a --conflicting-group-option --begin-group-a or any other input that would require more than one iteration, the second and following instances of --begin-group-a are always rejected as [blocked].

We can simplify this down to the following and the bug remains reproducible:

repeatable(
	required("--begin-group-a")
	&
	option("--conflicting-group-option")
)

Simplified even further:

repeatable(
	required("--begin-group-a").blocking(true)
	,
	option("--conflicting-group-option")
)

Reducing it to a single element within the repeatable group does not trigger the bug:

repeatable(
	group(
		required("--begin-group-a").blocking(true)
	).scoped(true)
)

--begin-group-a --begin-group-a is accepted.


Trying to avoid blocking arguments looks like it would work, but actually doesn't:

repeatable(
	required("--begin-group-a")
	,
	(
		option("--conflicting-group-option")
	)
)
|
repeatable(
	required("--begin-group-b")
	,
	(
		option("--conflicting-group-option")
	)
)

--group-option-a --conflicting-group-option --begin-group-a gives an unavoidable [conflict] on --conflicting-group-option.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions