pub fn from_parse_err(err: ParseError) -> Self {
        let at = match err {
            ParseError::Unexpected(at) => at,
            ParseError::UnexpectedExtra(at) => at,
            ParseError::UnexpectedWanted(_, at, _) => at,
            ParseError::UnexpectedDoubleBind(at) => at,
            ParseError::UnexpectedEOF | ParseError::UnexpectedEOFWanted(_) => {
                TextRange::empty(0u32.into())
            }
            _ => panic!("report a bug, pepper forgot to handle a parse error"),
        };
        let mut message = err.to_string();
        message
            .as_mut_str()
            .get_mut(0..1)
            .unwrap()
            .make_ascii_uppercase();
        Self::new("Syntax error", 0)
            .diagnostic(at, message)
            .severity(Severity::Error)
    }
/// Create a report out of a parse error
Create a report out of a parse error
Create a report out of a parse error
pub fn from_parse_err(err: ParseError) -> Self {
        let at = match err {
            ParseError::Unexpected(at) => at,
            ParseError::UnexpectedExtra(at) => at,
            ParseError::UnexpectedWanted(_, at, _) => at,
            ParseError::UnexpectedDoubleBind(at) => at,
            ParseError::UnexpectedEOF | ParseError::UnexpectedEOFWanted(_) => {
                TextRange::empty(0u32.into())
            }
            _ => panic!("report a bug, pepper forgot to handle a parse error"),
        };
        let mut message = err.to_string();
        message
            .as_mut_str()
            .get_mut(0..1)
            .unwrap()
            .make_ascii_uppercase();
        Self::new("Syntax error", 0)
            .diagnostic(at, message)
            .severity(Severity::Error)
    }
pub fn from_parse_err ( err : ParseError ) -> Self { let at = match err { ParseError :: Unexpected ( at ) => at , ParseError :: UnexpectedExtra ( at ) => at , ParseError :: UnexpectedWanted ( _ , at , _ ) => at , ParseError :: UnexpectedDoubleBind ( at ) => at , ParseError :: UnexpectedEOF | ParseError :: UnexpectedEOFWanted ( _ ) => { TextRange :: empty ( 0u32 . into ( ) ) } _ => panic ! ( " " ) , } ; let mut message = err . to_string ( ) ; message . as_mut_str ( ) . get_mut ( 0 .. 1 ) . unwrap ( ) . make_ascii_uppercase ( ) ; Self :: new ( " " , 0 ) . diagnostic ( at , message ) . severity ( Severity :: Error ) }
Create a report out of a parse error
Create a report out of a parse error
err
ParseError