Currently, it's not possible to do something like
if ( 1==1 ) then ( var := 'x' ) end;
as the parser will complain about a missing else. This could potentially be fine, since if you don't want an else you can use a no-op like
if ( 1==1 ) then ( var := 'x' ) else () end;
However, code like that can fail with the CachingParser if the if branch is empty. For instance,
if ( 1=== 1 ) then () else ( false ) end;
Yes, that could be inverted to make the else branch empty, but people should not be forced to do so. Instead, I'd propose to:
- Accept ifs without an else
- Require that the if condition is not empty
As a temporary workaround, it could also be fine to make CachingParser support empty conditions, but anyway we have to fix the issue before deploying CachingParser in prod.