Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/pe32/msvc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Some MSVC structs for RTTI and exception handling.

References:

[1]: [Reversing Microsoft Visual C++ Part I: Exception Handling](http://www.openrce.org/articles/full_view/21)
[2]: [Reversing Microsoft Visual C++ Part II: Classes, Methods and RTTI](http://www.openrce.org/articles/full_view/23)
[1]: [Reversing Microsoft Visual C++ Part I: Exception Handling](http://www.openrce.org/articles/full_view/21)
[2]: [Reversing Microsoft Visual C++ Part II: Classes, Methods and RTTI](http://www.openrce.org/articles/full_view/23)
*/

use std::mem;
Expand Down
10 changes: 9 additions & 1 deletion src/proc-macros/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ use proc_macro::*;
/// ```
#[proc_macro]
pub fn pattern(input: TokenStream) -> TokenStream {
let input = input.into_iter().collect::<Vec<_>>();
let mut input = input.into_iter().collect::<Vec<_>>();

// When calling the macro with a macro_rules capture, say $pat, the TokenTree
// will instead be a no-delimiter Group containing the expanded value of $pat.
// Unpack no-delimiter groups to handle this
match &input[..] {
[TokenTree::Group(g)] if g.delimiter() == Delimiter::None => input = g.stream().into_iter().collect::<Vec<_>>(),
_ => (),
};

let string = match &input[..] {
[TokenTree::Literal(lit)] => parse_str_literal(&lit),
Expand Down
Loading