DanielKeep / cargo-script

Cargo script subcommand
Other
729 stars 37 forks source link

work around Rust bug to allow macros in expr #17

Closed durka closed 8 years ago

durka commented 8 years ago

This is a workaround for a bug in Rust (rust-lang/rust#31946) which causes parsing to fail on macros defined within calls to println!.

DanielKeep commented 8 years ago

Just a question: is there any reason for the variable name to be like that? I mean, it does get immediately used (so it shouldn't need a leading _), and it's not in scope until the next statement, so it shouldn't conflict with anything. ... Unless the user does something pathological like:

"scope"}; { println!("Screw your attempt to {} me!", __cargo_script_expr)