teo-parser 0.3.0

Parser for Teo schema language
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use super::super::ast::span::Span;
use super::pest_parser::Pair;

pub(super) fn parse_span(pair: &Pair<'_>) -> Span {
    let start_line_col = pair.line_col();
    let pest_span = pair.as_span();
    let end_line_col = pest_span.end_pos().line_col();
    Span {
        start: pest_span.start(),
        end: pest_span.end(),
        start_position: start_line_col,
        end_position: end_line_col,
    }
}