mirror of
				https://github.com/rm-dr/daisy
				synced 2025-11-04 01:22:45 -08:00 
			
		
		
		
	Comments and whitespace
This commit is contained in:
		@@ -1,6 +1,9 @@
 | 
				
			|||||||
#[derive(Debug)]
 | 
					#[derive(Debug)]
 | 
				
			||||||
#[derive(Copy, Clone)]
 | 
					#[derive(Copy, Clone)]
 | 
				
			||||||
pub enum Function {
 | 
					pub enum Function {
 | 
				
			||||||
 | 
						// When adding a function, don't forget to update help command text.
 | 
				
			||||||
 | 
						// It isn't automatically generated.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	Abs,
 | 
						Abs,
 | 
				
			||||||
	Floor,
 | 
						Floor,
 | 
				
			||||||
	Ceil,
 | 
						Ceil,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,13 +11,16 @@ use super::Function;
 | 
				
			|||||||
#[derive(Copy)]
 | 
					#[derive(Copy)]
 | 
				
			||||||
#[repr(usize)]
 | 
					#[repr(usize)]
 | 
				
			||||||
pub enum Operator {
 | 
					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
 | 
						Define = 0, // Variable and function definition
 | 
				
			||||||
	ModuloLong, // Mod invoked with "mod"
 | 
						ModuloLong, // Mod invoked with "mod"
 | 
				
			||||||
	DivideLong,
 | 
						DivideLong, // Division invoked with "per"
 | 
				
			||||||
	UnitConvert,
 | 
						UnitConvert,
 | 
				
			||||||
	Subtract,
 | 
						Subtract,
 | 
				
			||||||
	Add,
 | 
						Add,
 | 
				
			||||||
	Divide,
 | 
						Divide, // Division invoked with "/"
 | 
				
			||||||
	Multiply,
 | 
						Multiply,
 | 
				
			||||||
	Modulo, // Mod invoked with %
 | 
						Modulo, // Mod invoked with %
 | 
				
			||||||
	Negative,
 | 
						Negative,
 | 
				
			||||||
@@ -76,7 +79,7 @@ impl Operator {
 | 
				
			|||||||
			"%"      => {Some( Operator::Modulo )},
 | 
								"%"      => {Some( Operator::Modulo )},
 | 
				
			||||||
			"mod"    => {Some( Operator::ModuloLong )},
 | 
								"mod"    => {Some( Operator::ModuloLong )},
 | 
				
			||||||
			"per"    => {Some( Operator::DivideLong )},
 | 
								"per"    => {Some( Operator::DivideLong )},
 | 
				
			||||||
			"to"    => {Some( Operator::UnitConvert )},
 | 
								"to"     => {Some( Operator::UnitConvert )},
 | 
				
			||||||
			"^"|"**" => {Some( Operator::Power )},
 | 
								"^"|"**" => {Some( Operator::Power )},
 | 
				
			||||||
			"!"      => {Some( Operator::Factorial )},
 | 
								"!"      => {Some( Operator::Factorial )},
 | 
				
			||||||
			"sqrt"|"rt"|"√" => {Some( Operator::Sqrt )},
 | 
								"sqrt"|"rt"|"√" => {Some( Operator::Sqrt )},
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user