convert the errors

This commit is contained in:
Tamo 2021-10-22 16:38:35 +02:00
parent d6ba84ea99
commit efb2f8b325
No known key found for this signature in database
GPG key ID: 20CD8020AFA88D69
4 changed files with 26 additions and 33 deletions

View file

@ -8,3 +8,4 @@ edition = "2021"
[dependencies]
nom = "7.0.0"
nom_locate = "4.0.0"
nom-greedyerror = "0.4.0"

View file

@ -24,17 +24,19 @@ use nom::branch::alt;
use nom::bytes::complete::tag;
use nom::character::complete::{char, multispace0};
use nom::combinator::map;
use nom::error::{ContextError, Error, VerboseError};
use nom::error::{ContextError, Error, ErrorKind, VerboseError};
use nom::multi::{many0, separated_list1};
use nom::number::complete::recognize_float;
use nom::sequence::{delimited, preceded, tuple};
use nom::{Finish, IResult};
use nom_greedyerror::GreedyError;
use nom_locate::LocatedSpan;
pub(crate) use value::parse_value;
pub type Span<'a> = LocatedSpan<&'a str>;
pub trait FilterParserError<'a>: nom::error::ParseError<Span<'a>> + ContextError<Span<'a>> {}
impl<'a> FilterParserError<'a> for GreedyError<Span<'a>, ErrorKind> {}
impl<'a> FilterParserError<'a> for VerboseError<Span<'a>> {}
impl<'a> FilterParserError<'a> for Error<Span<'a>> {}