Skip to content

Commit d013ece

Browse files
committed
fix(deps): remove nom
1 parent a641995 commit d013ece

File tree

2 files changed

+1
-67
lines changed

2 files changed

+1
-67
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ span = []
1717

1818
[dependencies]
1919
miette = "7.2.0"
20-
nom = "7.1.1"
2120
thiserror = "1.0.40"
2221
winnow = { version = "0.6.20", features = ["alloc", "unstable-recover"] }
2322

src/error.rs

Lines changed: 1 addition & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use std::{
44
};
55

66
use miette::{Diagnostic, SourceSpan};
7-
use nom::error::{ContextError, ErrorKind, FromExternalError, ParseError};
87
use thiserror::Error;
98

109
#[cfg(doc)]
@@ -103,68 +102,4 @@ pub enum KdlErrorKind {
103102
#[error("An unspecified parse error occurred.")]
104103
#[diagnostic(code(kdl::other))]
105104
Other,
106-
}
107-
108-
#[derive(Debug, Clone, Eq, PartialEq)]
109-
pub(crate) struct KdlParseError<I> {
110-
pub(crate) input: I,
111-
pub(crate) context: Option<&'static str>,
112-
pub(crate) len: usize,
113-
pub(crate) label: Option<&'static str>,
114-
pub(crate) help: Option<&'static str>,
115-
pub(crate) kind: Option<KdlErrorKind>,
116-
pub(crate) touched: bool,
117-
}
118-
119-
impl<I> ParseError<I> for KdlParseError<I> {
120-
fn from_error_kind(input: I, _kind: nom::error::ErrorKind) -> Self {
121-
Self {
122-
input,
123-
len: 0,
124-
label: None,
125-
help: None,
126-
context: None,
127-
kind: None,
128-
touched: false,
129-
}
130-
}
131-
132-
fn append(_input: I, _kind: nom::error::ErrorKind, other: Self) -> Self {
133-
other
134-
}
135-
}
136-
137-
impl<I> ContextError<I> for KdlParseError<I> {
138-
fn add_context(_input: I, ctx: &'static str, mut other: Self) -> Self {
139-
other.context = other.context.or(Some(ctx));
140-
other
141-
}
142-
}
143-
144-
impl<'a> FromExternalError<&'a str, ParseIntError> for KdlParseError<&'a str> {
145-
fn from_external_error(input: &'a str, _kind: ErrorKind, e: ParseIntError) -> Self {
146-
KdlParseError {
147-
input,
148-
len: 0,
149-
label: None,
150-
help: None,
151-
context: None,
152-
kind: Some(KdlErrorKind::ParseIntError(e)),
153-
touched: false,
154-
}
155-
}
156-
}
157-
158-
impl<'a> FromExternalError<&'a str, ParseFloatError> for KdlParseError<&'a str> {
159-
fn from_external_error(input: &'a str, _kind: ErrorKind, e: ParseFloatError) -> Self {
160-
KdlParseError {
161-
input,
162-
len: 0,
163-
label: None,
164-
help: None,
165-
context: None,
166-
kind: Some(KdlErrorKind::ParseFloatError(e)),
167-
touched: false,
168-
}
169-
}
170-
}
105+
}

0 commit comments

Comments
 (0)