Trait parsel::util::SpannedExt

source ·
pub trait SpannedExt: Spanned {
    fn format_span(&self) -> SpanDisplay;
    fn byte_range(&self, source: &str) -> Range<usize>;
    fn char_range(&self, source: &str) -> Range<usize>;
Expand description

Extension trait for formatting the span of AST nodes in a human-readable manner, and for (re-)computing byte offsets into the source based on the line/column location, since this information is not exposed by the public API of Span.

Required Methods