Skip to content

fix #2760#2783

Open
jonsequitur wants to merge 2 commits intodotnet:mainfrom
jonsequitur:fix-2760
Open

fix #2760#2783
jonsequitur wants to merge 2 commits intodotnet:mainfrom
jonsequitur:fix-2760

Conversation

@jonsequitur
Copy link
Contributor

@jonsequitur jonsequitur commented Mar 13, 2026

This addresses #2760 by adding a new property currently named Argument.CaptureRemainingTokens.

I'm not sure this is the right name but the behavior is that this argument will capture everything following it regardless of whether it happens to match some well-known symbol. A few notes on this implementation:

  • It's intended to be used with enumerable types but this is not enforced.
  • It stops capturing when it reaches the arity limit for the argument. For this reason, a name like Greedy might be more accurate. Can we assume this term is intuitive enough?
  • The -- token has no special meaning when captured by an Argument with this property set to true. It gets captured as one of the tokens.

@baronfel @tmds Thoughts?

@jonsequitur jonsequitur requested a review from adamsitnik March 13, 2026 17:55
@KalleOlaviNiemitalo
Copy link

The -- token has no special meaning when captured by an Argument with this property set to true. It gets captured as one of the tokens.

That is what I would expect.

@KalleOlaviNiemitalo
Copy link

It's intended to be used with enumerable types but this is not enforced.

I imagine a custom parser could very well transform this token sequence to a non-enumerable type.

@jonsequitur jonsequitur requested a review from baronfel March 13, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants