diff --git a/parsing/src/parsing.rs b/parsing/src/parsing.rs index dc2c211..1c2e875 100644 --- a/parsing/src/parsing.rs +++ b/parsing/src/parsing.rs @@ -145,11 +145,10 @@ pub fn is_letter(c: &char) -> bool { LETTERS.contains(&c) } #[inline] pub fn is_number(c: &char) -> bool { NUMBERS.contains(&c) } -/* -EXTREMELY Janky function that tries to put asterisks in the proper places to be parsed. This is so cursed. But it works, and I hopefully won't ever have to touch it again. -One limitation though, variables with multiple characters like `pi` cannot be multiplied (like `pipipipi` won't result in `pi*pi*pi*pi`). But that's such a niche use case (and that same thing could be done by using exponents) that it doesn't really matter. -In the future I may want to completely rewrite this or implement this natively in exmex. -*/ +/// EXTREMELY Janky function that tries to put asterisks in the proper places to be parsed. This is so cursed. But it works, and I hopefully won't ever have to touch it again. +/// One limitation though, variables with multiple characters like `pi` cannot be multiplied (like `pipipipi` won't result in `pi*pi*pi*pi`). But that's such a niche use case (and that same thing could be done by using exponents) that it doesn't really matter. +/// In the future I may want to completely rewrite this or implement this natively in exmex. +// TODO: use `split_function` here instead of this janky code pub fn process_func_str(function_in: &str) -> String { let function = function_in .replace("log10(", "log(") // log10 -> log