chumsky icon indicating copy to clipboard operation
chumsky copied to clipboard

Find a way to unify select! and select_ref!

Open zesterer opened this issue 1 year ago • 0 comments

Currently, zero-copy differentiates between select! and select_ref!: the former selects upon tokens by-value, the other by-ref.

The former is required for inputs that do not implement BorrowInput (i.e: those from which tokens cannot be borrowed, such as char from &str or T from Stream<T>), while the latter is required for cases where a reference to the original input is required (such as for parsing nested inputs).

It would be nice to unify these two cases into a single macro, ideally without requiring users to understand the intricate details.

zesterer avatar Mar 01 '23 17:03 zesterer