pub fn at<N, M, R>(source: Arc<File>, node: &N, message: M) -> Self
    where
        N: TypedNode<R>,
        M: Into<String>,
        R: TreeRoot<Types>,
    {
        let range = node.node().range();
        let span = source.span.subspan(
            range.start().to_usize() as u64,
            range.end().to_usize() as u64,
        );

        Self {
            span_loc: SpanLoc {
                begin: source.find_line_col(span.low()),
                end: source.find_line_col(span.high()),
                file: source,
            },
            span,
            message: message.into(),
        }
    }
/// Creates an error pointing into a source file.
///
/// # Parameters
///
/// * `source`: Source file the error occurred in.
/// * `node`: Parse tree node to highlight.
/// * `message`: The error message.
Creates an error pointing into a source file.
Creates an error pointing into a source file .
pub fn at<N, M, R>(source: Arc<File>, node: &N, message: M) -> Self
    where
        N: TypedNode<R>,
        M: Into<String>,
        R: TreeRoot<Types>,
    {
        let range = node.node().range();
        let span = source.span.subspan(
            range.start().to_usize() as u64,
            range.end().to_usize() as u64,
        );
        Self {
            span_loc: SpanLoc {
                begin: source.find_line_col(span.low()),
                end: source.find_line_col(span.high()),
                file: source,
            },
            span,
            message: message.into(),
        }
    }
pub fn at < N , M , R > ( source : Arc < File > , node : & N , message : M ) -> Self where N : TypedNode < R > , M : Into < String > , R : TreeRoot < Types > , { let range = node . node ( ) . range ( ) ; let span = source . span . subspan ( range . start ( ) . to_usize ( ) as u64 , range . end ( ) . to_usize ( ) as u64 , ) ; Self { span_loc : SpanLoc { begin : source . find_line_col ( span . low ( ) ) , end : source . find_line_col ( span . high ( ) ) , file : source , } , span , message : message . into ( ) , } }
Creates an error pointing into a source file.
Creates an error pointing into a source file .
source
Arc<File>
node
&N
message
M
source
Arc<File>
node
&N
message
M