Skip to main content

comment_lines

Function comment_lines 

Source
pub fn comment_lines<'arena>(trivia: &Trivia<'arena>) -> Vec<(u32, &'arena str)>
Expand description

Splits a comment into lines, preserving the offset of each line from the start of the trivia.

This is crucial for calculating the precise Span of pragmas within a comment.

ยงReturns

A Vec of (usize, &str) tuples, where the usize is the byte offset of the line from the start of the entire trivia text (including /**, //, etc.), and the &str is the cleaned line content.