Commit 98ea261
committed
Check valid punctuation character in Punct::new
Valid punctuation characters generated by:
use proc_macro::{Punct, Spacing, TokenStream};
use std::panic;
#[proc_macro]
pub fn punct_chars(_input: TokenStream) -> TokenStream {
for ch in '\0'..=char::MAX {
if let Ok(_) = panic::catch_unwind(|| {
let _ = Punct::new(ch, Spacing::Alone);
}) {
eprintln!("{:?}", ch);
}
}
TokenStream::new()
}1 parent d60aaad commit 98ea261
1 file changed
+10
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
835 | 835 | | |
836 | 836 | | |
837 | 837 | | |
838 | | - | |
839 | | - | |
840 | | - | |
841 | | - | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
842 | 848 | | |
843 | 849 | | |
844 | 850 | | |
| |||
0 commit comments