Release 10 posted of the Advanced Script Compiler. Direct download link (same as always):
http://www.nynaeve.n...iptCompiler.zip
You may use NWNScriptCompiler.ndl from the 'ToolsetPlugin' directory with NWNTX for NWN1. The standalone compiler EXE is also updated.
Release 10:
-----------
- A longstanding bug dating back to nwnnsscomp, where global variables that
were readonly and had initializers with assignments might be improperly
inlined if optimizations were enabled, has been fixed.
- The compiler can now optimize away dead sub-expressions in simple cases, such
as multiplication by zero or shift by 32 bits.
- The compiler can now optimize a multiply operation into a shift by power of
two.
- The compiler can now optimize addition by one and subtraction by one into a
decrement or increment operation.
- The compiler now issues a new warning, NSC6023, should function prototypes be
declared for the same function but with conflicting literal values for a
default value argument. It is legal for a prototype that does not set a
default value for an argument to follow a prototype that does set a default
value for an argument, but if a default value was set, it must match.
- A new pragma directive, #pragma pure_function(function-identifier), is now
supported. This pragma hints to the compiler that function-identifier, which
must be an already-declared function symbol, does not modify global state and
generates no side effects. This enables calls to the function to be elided
in certain circumstances, or for global variable initializer expressions that
invoke the function to be inlined in certain circumstances.
The programmer bears responsibility for ensuring that pure_function tagged
functions actually follow the rules for a pure function. Otherwise, program
behavior may be incorrect.