pub struct Range {
pub start: Pos,
pub end: Pos,
pub ctx: SyntaxCtxIndex,
}Expand description
Describes a position in a source code (syntax context). It’s useful to generate error messages.
Fields§
§start: Pos§end: Pos§ctx: SyntaxCtxIndexImplementations§
source§impl Range
impl Range
pub fn new(start: Pos, end: Pos, ctx: SyntaxCtxIndex) -> Range
pub fn ghost_range() -> Range
sourcepub fn mix(&self, next: Range) -> Range
pub fn mix(&self, next: Range) -> Range
Joins two ranges. It keeps the syntax context of the first one.
sourcepub fn set_ctx(&self, ctx: SyntaxCtxIndex) -> Range
pub fn set_ctx(&self, ctx: SyntaxCtxIndex) -> Range
Sets the context of the range,