OcelotProject / Ocelot

Ocelot is open-source linking for life cycle assessment. See https://ocelot.space/ for more information.
Other
25 stars 7 forks source link

Handle `if` in formulas #61

Closed cmutel closed 7 years ago

cmutel commented 8 years ago

For example: if(ep>130;2;3.3).

Maybe this could be rewritten with a regular expression, from if(a,b,c) to (b if a else c).

cmutel commented 8 years ago

Also need to handle power(10;-05).

cmutel commented 8 years ago

Current code fails for nested if statements. This could be fixed by using pyparsing or some other complicated grammar, but we can solve it now by manually replacing the few times this occurs.