File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,10 @@ impl LexError {
47
47
span : Span :: call_site ( ) ,
48
48
}
49
49
}
50
+
51
+ pub ( crate ) fn span ( & self ) -> Span {
52
+ self . span
53
+ }
50
54
}
51
55
52
56
impl TokenStream {
Original file line number Diff line number Diff line change @@ -250,6 +250,12 @@ impl Debug for TokenStream {
250
250
}
251
251
}
252
252
253
+ impl LexError {
254
+ pub fn span ( & self ) -> Span {
255
+ Span :: _new ( self . inner . span ( ) )
256
+ }
257
+ }
258
+
253
259
impl Debug for LexError {
254
260
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
255
261
Debug :: fmt ( & self . inner , f)
Original file line number Diff line number Diff line change @@ -243,6 +243,15 @@ impl Debug for TokenStream {
243
243
}
244
244
}
245
245
246
+ impl LexError {
247
+ pub ( crate ) fn span ( & self ) -> Span {
248
+ match self {
249
+ LexError :: Compiler ( _) => Span :: call_site ( ) ,
250
+ LexError :: Fallback ( e) => Span :: Fallback ( e. span ( ) ) ,
251
+ }
252
+ }
253
+ }
254
+
246
255
impl From < proc_macro:: LexError > for LexError {
247
256
fn from ( e : proc_macro:: LexError ) -> LexError {
248
257
LexError :: Compiler ( e)
You can’t perform that action at this time.
0 commit comments