From 203401024774d779764843cc42be03d2f304aad1 Mon Sep 17 00:00:00 2001 From: Jake Date: Wed, 4 Sep 2024 22:31:54 -0700 Subject: [PATCH] Add pi and C for speed of light --- src/main.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 9efa0f5..f7069c6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,7 +8,7 @@ pub mod lexer; pub mod parse; fn interactive() { - let verbose = true; + let verbose = false; let mut local_memory = HashMap::new(); @@ -20,6 +20,22 @@ fn interactive() { }, ); + local_memory.insert( + "pi".to_string(), + Token { + token_type: TokenType::NumericDecLiteral, + value: std::f64::consts::PI.to_string(), + }, + ); + + local_memory.insert( + "C".to_string(), + Token { + token_type: TokenType::NumericIntLiteral, + value: "299792458".to_string(), + }, + ); + loop { print!("{}", color!(Color::GREEN, bold!("\n> ").as_str())); stdout().flush().expect("Failed to flush stdout");