dtolnay / watt

Runtime for executing procedural macros as WebAssembly
Apache License 2.0
1.29k stars 28 forks source link

Allow raw identifiers #34

Closed CAD97 closed 4 years ago

CAD97 commented 4 years ago

Fixes #33

Tested with the same patch to the demo derive as in the issue, which now gives

message=Ok(Ident { sym: r#raw, span: Span { handle: 4, _marker: PhantomData } })
CAD97 commented 4 years ago

GitHub suggested is r? @alexcrichton

CAD97 commented 4 years ago

I don't know if this is the actual desired semantics of the proc-macro2 API; this was just a minimal change in order to get the observed behavior in syn to not panic. Note that the proc-macro2 fallback imp has ::new and ::new_raw, neither of which strip r# from the start.