storm
storm copied to clipboard
Fix Formula Parser
Fixed parsing expression formulas (fixes #195)
The issue was that if we see an opening bracket (
we expected that there is a formula inside the brackets. This is not the case for formulas like (1)=2
as 1 is not a formula.
Fixed backtracking mode in expression parser
With backtracking enabled, the expression parser is not supposed to throw an exception on a formula like 1 & true
.
However, when such an error is encountered the expression parser currently overwrites the result parsed so far with a dummy expression which results in a BAD_ACCESS signal. This commit fixes the issue.
LGTM; but I am not a parser expert :-)
I'll do some more tests on a larger set of formulas (i.e. QVBS) before we merge. The parser is very delicate ;)
I've let this run on an extensive set of formulas (QVBS plus some others) without issues so I think this is ready for merge.