@@ -4,7 +4,6 @@ use std::{
4
4
} ;
5
5
6
6
use miette:: { Diagnostic , SourceSpan } ;
7
- use nom:: error:: { ContextError , ErrorKind , FromExternalError , ParseError } ;
8
7
use thiserror:: Error ;
9
8
10
9
#[ cfg( doc) ]
@@ -103,68 +102,4 @@ pub enum KdlErrorKind {
103
102
#[ error( "An unspecified parse error occurred." ) ]
104
103
#[ diagnostic( code( kdl:: other) ) ]
105
104
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