How to parse single tokens in rust macros
问题 I'm starting playing with Rust macros and I came to try this little practice example. I want to define a macro that expands into a variable initialization (name doesn't matter) of type i32 (for example, but not really important) and a series of operations to that variable, in this case a var += 1 or a var -= 1 and finally it will call println!("{}", var) . The macro will take a series of tokens based on + and - that matches the operations described above. So for example: operate_integer![+++-