Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi: Closing Brackets Optional?

I have noticed quite a few times that syntax errors like

Exit(push(ASBDD(asPixmap, _ScriptSavePixmap(Script, PMRGBAdjust(_ScriptGetPixmap(Script, Args[0].Index), adjparams))));

actually compiles. Notice that one closing bracket ) is missing. (Of course it also compiles if I add this missing bracket!)

Is this a documented feature?

like image 371
Andreas Rejbrand Avatar asked Apr 28 '26 02:04

Andreas Rejbrand


1 Answers

Additional info: The statement in question is the last statement in a code block. Inserting any statement after this statement will cause the compiler to report the correct missing ")" error.

It would appear that the compiler loses track of the missing ")" error when it encounters the end of the block. This is most likely a compiler bug. It seems likely to me that this anomaly has been around for a long time. Don't rely on it.

like image 149
dthorpe Avatar answered Apr 30 '26 15:04

dthorpe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!