I want to read files written using the Mathematica function 'Save'. Inside, their are expressions that I would like to translate in lua.
For example: mathematica -> lua
foo[bar_]:= a*bar + b -> function foo(bar) return a*bar + b end
foo[bar_]= a*bar + b -> foo[bar] = a*bar + b
foo = N[bar] -> foo = bar
Pi or \[Pi] or -> math.pi
-7.809692029744407*^-8 -> -7.809692029744407e-8
2.7067*^-8 + 2.268*^-8*I -> 2.7067e-8 + 2.268e-8*math.i
This is not necessarily a hard problem, I just have to learn the lua regular expressions. But their is a lot of cases (not mentioned above) to take into account and I do not want to "reinvent the wheel". Maybe I should, you would say...
But anyways, is there a lua library or a project devoted to that?