pub fn from_lalrpop<T>(filemap: &FileMap, err: LalrpopError<ByteIndex, T, ParseError>) -> ParseError
where
    T: Into<Token<String>>,
{
    match err {
        LalrpopError::User { error } => error,
        LalrpopError::InvalidToken { .. } => unreachable!(),
        LalrpopError::UnrecognizedToken {
            token: None,
            expected,
        } => ParseError::UnexpectedEof {
            end: filemap.span().end(),
            expected: ExpectedTokens(expected),
        },
        LalrpopError::UnrecognizedToken {
            token: Some((start, token, end)),
            expected,
        } => ParseError::UnexpectedToken {
            span: ByteSpan::new(start, end),
            token: token.into(),
            expected: ExpectedTokens(expected),
        },
        LalrpopError::ExtraToken {
            token: (start, token, end),
        } => ParseError::ExtraToken {
            span: ByteSpan::new(start, end),
            token: token.into(),
        },
    }
}
/// Flatten away an LALRPOP error, leaving the inner `ParseError` behind
Flatten away an LALRPOP error, leaving the inner `ParseError` behind
Flatten away an LALRPOP error leaving the inner ` ParseError ` behind
pub fn from_lalrpop<T>(filemap: &FileMap, err: LalrpopError<ByteIndex, T, ParseError>) -> ParseError
where
    T: Into<Token<String>>,
{
    match err {
        LalrpopError::User { error } => error,
        LalrpopError::InvalidToken { .. } => unreachable!(),
        LalrpopError::UnrecognizedToken {
            token: None,
            expected,
        } => ParseError::UnexpectedEof {
            end: filemap.span().end(),
            expected: ExpectedTokens(expected),
        },
        LalrpopError::UnrecognizedToken {
            token: Some((start, token, end)),
            expected,
        } => ParseError::UnexpectedToken {
            span: ByteSpan::new(start, end),
            token: token.into(),
            expected: ExpectedTokens(expected),
        },
        LalrpopError::ExtraToken {
            token: (start, token, end),
        } => ParseError::ExtraToken {
            span: ByteSpan::new(start, end),
            token: token.into(),
        },
    }
}
pub fn from_lalrpop < T > ( filemap : & FileMap , err : LalrpopError < ByteIndex , T , ParseError > ) -> ParseError where T : Into < Token < String > > , { match err { LalrpopError :: User { error } => error , LalrpopError :: InvalidToken { .. } => unreachable ! ( ) , LalrpopError :: UnrecognizedToken { token : None , expected , } => ParseError :: UnexpectedEof { end : filemap . span ( ) . end ( ) , expected : ExpectedTokens ( expected ) , } , LalrpopError :: UnrecognizedToken { token : Some ( ( start , token , end ) ) , expected , } => ParseError :: UnexpectedToken { span : ByteSpan :: new ( start , end ) , token : token . into ( ) , expected : ExpectedTokens ( expected ) , } , LalrpopError :: ExtraToken { token : ( start , token , end ) , } => ParseError :: ExtraToken { span : ByteSpan :: new ( start , end ) , token : token . into ( ) , } , } }
Flatten away an LALRPOP error, leaving the inner `ParseError` behind
Flatten away an LALRPOP error leaving the inner ` ParseError ` behind
filemap
&FileMap
err
LalrpopError<ByteIndex, T, ParseError>
filemap
&FileMap
err
LalrpopError<ByteIndex, T, ParseError>