Expand description
Bridge between Praxis spans and rowan’s text offsets.
Praxis Span/BytePos are the source of truth for diagnostics and never
leak rowan types outward. Internally, rowan indexes the tree with its own
TextSize/TextRange (also byte offsets into UTF-8). Neither type is local
to this crate, so the orphan rule forbids From impls between them; these
free functions are the only place the two meet (ADR-003).
Prefer the explicit span_to_range / range_to_span calls at the tree
boundary over implicit conversions, so every crossing is visible.
Functions§
- range_
to_ span - Convert a rowan
TextRangeback into a PraxisSpan. - span_
to_ range - Convert a Praxis
Spaninto a rowanTextRange.