pub fn attach_trivia(source: &str, sheet: &mut Sheet)Expand description
Recovers comments/blank-lines from every gap in sheet — a leading comment before the
sheet keyword itself, its own top-level items, and every nested relationship/conditional
body — attaching each to the nearest following node.
-
Precondition:
sheetwas parsed from exactlysource(unmodified), so its items’ spans’ line/column positions resolve correctly against it. -
Complexity: O(n) in the length of
sourceplus the number of nested lists — every gap’sLineColumn -> byte offsetconversion reuses the sharedline_startstable computed once up front (seeline_start_byte_offsets), rather than rescanningsourceper gap.