Think about a replacement of Capture by RefValue with a new value type Capture, so that Repeat returns a capture range and not a list of values
In general, this is a huge change to Tokay and the current implementation, but should be kept in mind and discussed.
Right now, a change would be to big. There's also the possibility of a hybrid-implementation. An important note is, that Capture-Objects must be referenced by the VM to turn Captures into Values as soon as the Reader is committed, and any range definitions become invalid.
This issue was a point in the checklist on #105:
In general, this is a huge change to Tokay and the current implementation, but should be kept in mind and discussed. Right now, a change would be to big. There's also the possibility of a hybrid-implementation. An important note is, that Capture-Objects must be referenced by the VM to turn Captures into Values as soon as the Reader is committed, and any range definitions become invalid.