Skip to content

Commit

Permalink
add span for struct field peek parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
sharnoff committed Nov 23, 2020
1 parent 29f8c2e commit 3834937
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,11 @@ fn handle_field_attrs(field_name: &Ident, ty_span: Span, attrs: FieldAttrs) -> P

if let Some(p) = attrs.peek {
parse_expr = match p {
PeekAttr::Peek(expr) => quote!(match #input_source.peek(#expr) {
PeekAttr::Peek(expr) => quote_spanned!(expr.span()=> match #input_source.peek(#expr) {
true => Some(#parse_expr),
false => None,
}),
PeekAttr::PeekWith(expr) => quote!(match (#expr)(#input_source) {
PeekAttr::PeekWith(expr) => quote_spanned!(expr.span()=> match (#expr)(#input_source) {
true => Some(#parse_expr),
false => None,
}),
Expand Down

0 comments on commit 3834937

Please sign in to comment.