Associate collected trivia with the spans the printer will look up.
collect is a dry printing pass that records those spans. Association runs
over the spans that are BOTH a parse node and looked up by the printer --
the two sets clip each other in opposite directions and neither alone will
do:
- dropping a parse node the printer skips keeps its comments from being
silently lost; they bubble up to an enclosing node that does print.
- dropping a looked-up span that no parse node owns keeps a comment from
landing somewhere that is not a source construct. The printer stamps
some output with the span of a mere TOKEN, and such a span can outrank
the real nodes and steal the file's leading comments.
Returns the table and the leftovers no location owns -- trailing comments
past the last node, or the whole file when there are no nodes at all. The
caller prints those as tail trivia.