aboutsummaryrefslogtreecommitdiff
path: root/src/attr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/attr.rs')
-rw-r--r--src/attr.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/attr.rs b/src/attr.rs
index 8626d11..d66b843 100644
--- a/src/attr.rs
+++ b/src/attr.rs
@@ -1,6 +1,6 @@
use crate::error::Result;
use crate::segment::{self, Segment};
-use proc_macro::{Delimiter, Group, Span, TokenStream, TokenTree};
+use proc_macro::{Delimiter, Group, Spacing, Span, TokenStream, TokenTree};
use std::iter;
use std::mem;
use std::str::FromStr;
@@ -157,6 +157,8 @@ fn is_stringlike(token: &TokenTree) -> bool {
None => false,
}
}
- TokenTree::Punct(punct) => punct.as_char() == '\'' || punct.as_char() == ':',
+ TokenTree::Punct(punct) => {
+ punct.as_char() == '\'' || punct.as_char() == ':' && punct.spacing() == Spacing::Alone
+ }
}
}