Here is a summary of recent DWScript changes, the major one is a change in operator precedence to something similar to Delphi and FreePascal.
Other changes are related to sets and bug fixes.
The precedence of operators has been changed to be inline with Delphi & FreePascal, this means that
- AND, AS, SHL, SHR and SAR precedences are increased
- IN and IMPLIES precedences are decreased
And the DWScript operator precedence table is now
- @, not
- *, /, div, mod, and, shl, shr, sar, as, ^, <<, >>
- +, -, or, xor
- =, <>, <, >, <=, >=, in, is, implies, implements
Other miscellaneous notes on operators:
- operators ^, <<, >> are only supported for operator overloading, and do not have a default meaning, though ^ was intended for vector and matrix operations (rather than legacy dereferencing), while << and >> were intended for streaming or prefixing/post-fixing (rather than shr/shl alternatives).
- SAR is the “shift arithmetic right” operator, which preserves the sign bit while SHR does not.
- IMPLIES has low precedence like in Oxygene.
- small sets (with 31 elements or less) can now be cast to integer and vice-versa
- fixed support for set constants in default function parameters
- fixed support for the empty sets as function parameter
- inline record constants are now supported in record and class declarations (for field default values)
- fixed an issue with break/continue in the JIT compiler when encountered in blocks that are not supported by the JIT compiler (bug in the fallback mechanism).
- fixed an issue with RTTI symbol enumeration across units