One very common parsing scenario in programming languages is an arbitrary-length nonempty list of elements with a separator, for example:
[1, 2, 3, 4, 5]
f(a, b, c)
I've been parsing this in treesitter as follows:
list: $ => seq(
repeat(seq($.element, ',')),
$.element
)
This works, but it's common enough that I wonder whether treesitter has a built-in construct for it. Does it?