From 5d234b9ff6dc32ea73a0a8f2627cb2430081e1fe Mon Sep 17 00:00:00 2001 From: Mark Date: Tue, 1 Aug 2023 09:44:05 -0700 Subject: [PATCH] Comments and whitespace --- src/parser/expression/function.rs | 3 +++ src/parser/expression/operator.rs | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/parser/expression/function.rs b/src/parser/expression/function.rs index d1efd74..ba73686 100644 --- a/src/parser/expression/function.rs +++ b/src/parser/expression/function.rs @@ -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, diff --git a/src/parser/expression/operator.rs b/src/parser/expression/operator.rs index 1aee6f6..7d2e798 100644 --- a/src/parser/expression/operator.rs +++ b/src/parser/expression/operator.rs @@ -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 )},