stefnotch / quantum-sheet

QuantumSheet - A user friendly mathematics worksheet and solver
https://stefnotch.github.io/quantum-sheet/
GNU General Public License v3.0
55 stars 5 forks source link

Add defined variables to dictionary #37

Open stefnotch opened 2 years ago

stefnotch commented 2 years ago

When parsing or serializing an expression, we need to get all the currently defined variables and add them to the dictionary. That way, cat := 3 followed by cat = will work correctly

stefnotch commented 2 years ago

Also, the := parser might have to be rewritten a little bit to do some custom parsing for the right side. Let's first see how the next MathJson version handles various things.

stefnotch commented 2 years ago

Test case: % := 1/100

phcreery commented 2 years ago

Another one is subscripts. I often use subscripts to differentiate the same variables for different domains. Wearth=m*gearth and Wmars=m*gmars