Constant changes

pull/2/head
Mark 2023-03-26 10:18:39 -07:00
parent 8a58d2182a
commit c92670c918
Signed by: Mark
GPG Key ID: AD62BB059C2AAEE4
2 changed files with 11 additions and 7 deletions

View File

@ -44,22 +44,22 @@ pub fn p_find_subs(
"zeta" => {Some("ζ")}, "zeta" => {Some("ζ")},
"eta" => {Some("η")}, "eta" => {Some("η")},
"theta" => {Some("θ")}, "theta" => {Some("θ")},
"iota" => {Some("ι")}, //"iota" => {Some("ι")},
"kappa" => {Some("κ")}, //"kappa" => {Some("κ")},
"lambda" => {Some("λ")}, "lambda" => {Some("λ")},
"mu" => {Some("μ")}, "mu" => {Some("μ")},
"nu" => {Some("ν")}, //"nu" => {Some("ν")},
"xi" => {Some("ξ")}, "xi" => {Some("ξ")},
"omicron" => {Some("ο")}, //"omicron" => {Some("ο")},
"pi" => {Some("π")}, "pi" => {Some("π")},
"rho" => {Some("ρ")}, "rho" => {Some("ρ")},
"sigma" => {Some("σ")}, "sigma" => {Some("σ")},
"tau" => {Some("τ")}, "tau" => {Some("τ")},
"upsilon" => {Some("υ")}, //"upsilon" => {Some("υ")},
"phi" => {Some("φ")}, "phi" => {Some("φ")},
"chi" => {Some("χ")}, "chi" => {Some("χ")},
"psi" => {Some("ψ")}, "psi" => {Some("ψ")},
"omega" => {Some("ω")} "omega" => {Some("ω")},
_ => {None} _ => {None}
}; };

View File

@ -93,7 +93,11 @@ pub fn p_groupify(mut g: VecDeque<Token>) -> Result<Token, (LineLocation, Parser
// unicode versions of each word. // unicode versions of each word.
v_now.push_back(match &s[..] { v_now.push_back(match &s[..] {
"mod" => { Token::PreOperator(l, Operator::ModuloLong) }, "mod" => { 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))); } _ => { return Err((l, ParserError::Undefined(s))); }
}); });
lookback(v_now)?; lookback(v_now)?;