From c92670c918d32e212c97cad7c3bf27ee72740ca3 Mon Sep 17 00:00:00 2001 From: Mark Date: Sun, 26 Mar 2023 10:18:39 -0700 Subject: [PATCH] Constant changes --- src/parser/find_subs.rs | 12 ++++++------ src/parser/groupify.rs | 6 +++++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/parser/find_subs.rs b/src/parser/find_subs.rs index ac2d9f4..ceed468 100644 --- a/src/parser/find_subs.rs +++ b/src/parser/find_subs.rs @@ -44,22 +44,22 @@ pub fn p_find_subs( "zeta" => {Some("ζ")}, "eta" => {Some("η")}, "theta" => {Some("θ")}, - "iota" => {Some("ι")}, - "kappa" => {Some("κ")}, + //"iota" => {Some("ι")}, + //"kappa" => {Some("κ")}, "lambda" => {Some("λ")}, "mu" => {Some("μ")}, - "nu" => {Some("ν")}, + //"nu" => {Some("ν")}, "xi" => {Some("ξ")}, - "omicron" => {Some("ο")}, + //"omicron" => {Some("ο")}, "pi" => {Some("π")}, "rho" => {Some("ρ")}, "sigma" => {Some("σ")}, "tau" => {Some("τ")}, - "upsilon" => {Some("υ")}, + //"upsilon" => {Some("υ")}, "phi" => {Some("φ")}, "chi" => {Some("χ")}, "psi" => {Some("ψ")}, - "omega" => {Some("ω")} + "omega" => {Some("ω")}, _ => {None} }; diff --git a/src/parser/groupify.rs b/src/parser/groupify.rs index 279ccce..7d7f4e3 100644 --- a/src/parser/groupify.rs +++ b/src/parser/groupify.rs @@ -93,7 +93,11 @@ pub fn p_groupify(mut g: VecDeque) -> Result { Token::PreOperator(l, Operator::ModuloLong) }, - "π"|"pi" => { Token::Constant(l, 3.141592653, String::from("π")) }, + + // Mathematical constants + "π"|"pi" => { Token::Constant(l, 3.141592653, String::from("pi")) }, + "e" => { Token::Constant(l, 2.71828, String::from("e")) }, + "phi"|"φ" => { Token::Constant(l, 1.61803, String::from("phi")) }, _ => { return Err((l, ParserError::Undefined(s))); } }); lookback(v_now)?;