Context: #1627 (comment)
// TODO(v2): this currently has a bug, and might return a smaller range than expected,
// because `structured_cst` doesn't capture all nodes in input (like separators).
// We need to represent all non-trivia nodes in the CST.
[@teofr] I'll take a look at it, thanks!
[@OmarTawfik] Sounds great. Thank you!
I will move this TODO to an issue for you then.
I briefly into it, and for separators specifically, I don't think adding/removing it from the CST will impact this specific validation/this PR, given they are never of interest, and we don't have trailing separators, so they can't influence the calculated ranges.
We already include a bunch of punctuation terminals in the CST that we don't strictly need, and we have discussed possibly removing them in the future.
But we might want to review the rest of the grammar just to make sure we are not missing anything more impactful. Feel free to close it if it is no-op.
Context: #1627 (comment)