chiark / gitweb /
use multiplication
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 10 May 2024 12:56:51 +0000 (13:56 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 10 May 2024 12:56:51 +0000 (13:56 +0100)
src/main.rs

index e44b451ce42dd84dba6cb04a3d969be207cff472..bdf2b1dbc93e57640de831254fdf86e3cabcc72d 100644 (file)
@@ -2,18 +2,18 @@
 use foo_macros::*;
 
 macro_rules! one_plus { { $v:expr } => {
-    1 + $v
+    2 * $v
 } }
 macro_rules! one_plus_dbg { { $v:expr } => {
-    dbg_dump!(1 + $v)
+    dbg_dump!(2 * $v)
 } }
 macro_rules! one_plus_reconstruct { { $v:expr } => {
-    reconstruct_groups!(1 + $v)
+    reconstruct_groups!(2 * $v)
 } }
 
 fn main() {
-    println!("1 + (2<<3) should be 17");
-    println!("{} without proc_macro", one_plus!(2 << 3));
-    println!("{} dbg_dump", one_plus_dbg!(2 << 3));
-    println!("{} reconstruct", one_plus_reconstruct!(2 << 3));
+    println!("2 * (3 + 4) should be 14");
+    println!("{} without proc_macro", one_plus!(3 + 4));
+    println!("{} dbg_dump", one_plus_dbg!(3 + 4));
+    println!("{} reconstruct", one_plus_reconstruct!(3 + 4));
 }