Skip to main content

Module shared

Module shared 

Source

Functions§

to_parser_span
Convert grammar span (LocatedSpan) to parser span (line/column)
to_parser_span_range
Convert grammar span range (start, end) to parser span Convert a grammar span range where end is the remainder span (i.e. the nom rest after a match). This sets the end position to the end.location_offset() (start of the remainder), matching inline parser usage patterns like to_parser_span_range(start, rest).
to_parser_span_range_inclusive
Convert a grammar span range where end is the final fragment of the matched range (i.e. inclusive). This preserves the previous block-level semantics where callers pass the last fragment and expect the end to be at end.location_offset() + end.fragment().len().

Type Aliases§

GrammarSpan
Grammar span type (nom_locate::LocatedSpan)