storm icon indicating copy to clipboard operation
storm copied to clipboard

Fix Formula Parser

Open tquatmann opened this issue 2 years ago • 2 comments

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.

tquatmann avatar Oct 05 '22 06:10 tquatmann

LGTM; but I am not a parser expert :-)

sjunges avatar Oct 05 '22 07:10 sjunges

I'll do some more tests on a larger set of formulas (i.e. QVBS) before we merge. The parser is very delicate ;)

tquatmann avatar Oct 05 '22 09:10 tquatmann

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.

tquatmann avatar Jan 23 '23 15:01 tquatmann