cue/format: fix comma placement for ellipsis with inline comments
When formatting list elements like `...string // comment`, the comma
was placed after the comment instead of before it. The fix collects
trailing comments from the type and defers them until after the comma.
Fixes #4238
Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: I2b40bab3f5c0c6bed3bd2e010f6a2c2e72c955d8
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1229757
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Matthew Sackman <matthew@cue.works>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>