no factorials

This commit is contained in:
Simon Gardling
2022-02-17 11:35:16 -05:00
parent e1c5d8c42c
commit 6723354e83
2 changed files with 8 additions and 1 deletions

View File

@@ -65,6 +65,11 @@ impl ChartManager {
// Tests function to make sure it's able to be parsed. Returns the string of the Error produced, or an empty string if it runs successfully.
pub fn test_func(function_string: String) -> String {
// Factorials do not work, and it would be really difficult to make them work
if function_string.contains("!") {
return "Factorials are unsupported".to_string();
}
let new_func_str: String = add_asterisks(function_string.clone());
let expr_result = new_func_str.parse();
let expr_error = match &expr_result {