aboutsummaryrefslogtreecommitdiff
path: root/src/lex
diff options
context:
space:
mode:
Diffstat (limited to 'src/lex')
-rw-r--r--src/lex/mod.rs6
1 files changed, 3 insertions, 3 deletions
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 {
70} 70}
71 71
72lazy_static! { 72lazy_static! {
73 static ref CONSTANTS: HashMap<&'static str, Token> = { 73 pub static ref CONSTANTS: HashMap<&'static str, Token> = {
74 let mut m = HashMap::new(); 74 let mut m = HashMap::new();
75 m.insert("e", Token::Num(std::f64::consts::E)); 75 m.insert("e", Token::Num(std::f64::consts::E));
76 m.insert("pi", Token::Num(std::f64::consts::PI)); 76 m.insert("pi", Token::Num(std::f64::consts::PI));
77 m 77 m
78 }; 78 };
79 79
80 static ref FUNCTIONS: HashMap<&'static str, Token> = { 80 pub static ref FUNCTIONS: HashMap<&'static str, Token> = {
81 let mut m = HashMap::new(); 81 let mut m = HashMap::new();
82 m.insert("sin", Function::token_from_fn("sin".into(), |x| is_radian_mode(x, CONFIGURATION.radian_mode).sin())); 82 m.insert("sin", Function::token_from_fn("sin".into(), |x| is_radian_mode(x, CONFIGURATION.radian_mode).sin()));
83 m.insert("cos", Function::token_from_fn("cos".into(), |x| is_radian_mode(x, CONFIGURATION.radian_mode).cos())); 83 m.insert("cos", Function::token_from_fn("cos".into(), |x| is_radian_mode(x, CONFIGURATION.radian_mode).cos()));
@@ -106,7 +106,7 @@ lazy_static! {
106 m 106 m
107 }; 107 };
108 108
109 static ref OPERATORS: HashMap<char, Token> = { 109 pub static ref OPERATORS: HashMap<char, Token> = {
110 let mut m = HashMap::new(); 110 let mut m = HashMap::new();
111 m.insert('+', Operator::token_from_op('+', |x, y| x + y, 2, true)); 111 m.insert('+', Operator::token_from_op('+', |x, y| x + y, 2, true));
112 m.insert('-', Operator::token_from_op('-', |x, y| x - y, 2, true)); 112 m.insert('-', Operator::token_from_op('-', |x, y| x - y, 2, true));