When assigning to a bit/logic variable inside a constant function, the RHS expression value must be trimmed to match the size of the variable.
Handle uninitialised variables in constant user functions.
UPDATE: Removed white space error.
Pure functions with constant operands can be evaluated at compile time rather than at run time. This patch provides a global control to enable this optimisation. Until constant function support is complete, by default it is disabled.
This patch adds support for disable statements and system task calls in constant user functions. It also makes the checks for a function being constant work when the function contains nested scopes (named blocks).
Here is a bundle of regression tests that check the above changes. All the tests are self-checking and need no special compiler flags.
This patch contains a few tweaks to improve the error reporting when an error is detected in a constant user function.
I'm going to pause here until the backlog clears.
Applied to git master.