From 4ceb052b46e05d7f0d6def3e5c46a612ae126d72 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Wed, 23 Feb 2022 10:01:06 -0500 Subject: [PATCH] multiline comment --- src/misc.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/misc.rs b/src/misc.rs index 4ba027d..3c425bf 100644 --- a/src/misc.rs +++ b/src/misc.rs @@ -3,9 +3,11 @@ use wasm_bindgen::prelude::*; pub type DrawResult = Result>; -// 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 into mevel-rs (which would probably be good to do) +/* +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 into mevel-rs (which would probably be good to do) +*/ pub fn add_asterisks(function_in: String) -> String { let function = function_in.replace("log10(", "log(").replace("pi", "π"); // pi -> π and log10 -> log let valid_variables: Vec = "xeπ".chars().collect();