From ea95516537b9ef2c9badd01abcf72f20066f9c55 Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Mon, 2 Nov 2020 01:28:05 +0800 Subject: Add help command Close #41 --- src/lex/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lex') diff --git a/src/lex/mod.rs b/src/lex/mod.rs index 3222c12..b3faff8 100644 --- a/src/lex/mod.rs +++ b/src/lex/mod.rs @@ -70,14 +70,14 @@ pub enum Token { } lazy_static! { - static ref CONSTANTS: HashMap<&'static str, Token> = { + pub static ref CONSTANTS: HashMap<&'static str, Token> = { let mut m = HashMap::new(); m.insert("e", Token::Num(std::f64::consts::E)); m.insert("pi", Token::Num(std::f64::consts::PI)); m }; - static ref FUNCTIONS: HashMap<&'static str, Token> = { + pub static ref FUNCTIONS: HashMap<&'static str, Token> = { let mut m = HashMap::new(); m.insert("sin", Function::token_from_fn("sin".into(), |x| is_radian_mode(x, CONFIGURATION.radian_mode).sin())); m.insert("cos", Function::token_from_fn("cos".into(), |x| is_radian_mode(x, CONFIGURATION.radian_mode).cos())); @@ -106,7 +106,7 @@ lazy_static! { m }; - static ref OPERATORS: HashMap = { + pub static ref OPERATORS: HashMap = { let mut m = HashMap::new(); m.insert('+', Operator::token_from_op('+', |x, y| x + y, 2, true)); m.insert('-', Operator::token_from_op('-', |x, y| x - y, 2, true)); -- cgit v1.2.3