Comments and whitespace

pull/2/head
Mark 2023-08-01 09:44:05 -07:00
parent 47cbd29c27
commit 5d234b9ff6
Signed by: Mark
GPG Key ID: AD62BB059C2AAEE4
2 changed files with 9 additions and 3 deletions

View File

@ -1,6 +1,9 @@
#[derive(Debug)]
#[derive(Copy, Clone)]
pub enum Function {
// When adding a function, don't forget to update help command text.
// It isn't automatically generated.
Abs,
Floor,
Ceil,

View File

@ -11,13 +11,16 @@ use super::Function;
#[derive(Copy)]
#[repr(usize)]
pub enum Operator {
// When adding operators, don't forget to update help command text.
// It isn't automatically generated.
Define = 0, // Variable and function definition
ModuloLong, // Mod invoked with "mod"
DivideLong,
DivideLong, // Division invoked with "per"
UnitConvert,
Subtract,
Add,
Divide,
Divide, // Division invoked with "/"
Multiply,
Modulo, // Mod invoked with %
Negative,
@ -76,7 +79,7 @@ impl Operator {
"%" => {Some( Operator::Modulo )},
"mod" => {Some( Operator::ModuloLong )},
"per" => {Some( Operator::DivideLong )},
"to" => {Some( Operator::UnitConvert )},
"to" => {Some( Operator::UnitConvert )},
"^"|"**" => {Some( Operator::Power )},
"!" => {Some( Operator::Factorial )},
"sqrt"|"rt"|"" => {Some( Operator::Sqrt )},