Änderungen

Summary

  1. [WIP] Lua typecasting (#997) (commit: 31d097f) (details)
Commit 31d097f2cbdefe9b6cf9fff7ad04e45ac2f3b99f by noreply
[WIP] Lua typecasting (#997)
* first attempt
uses typeEnsure functions to ensure correct types at all times
intermediate language is not the same as in JASS, so compiletime
execution is not correct

* restore fromIndex and toIndex functions for intermediate language
The typeEnsure functions have no effect on compiletime, so lua
compiletime should now be exactly like JASS compiletime.
ensured with intEnsure
JASS
though they are already integers, so it would not be necessary

* restore fromIndex and toIndex for overrides

* remove unnecessary typeEnsure function

* reactivate jass testing

* replace non numeric zero compiletime results with null/nil in lua
compiletime results are initially evaluated to 0 for objects that are
null

* fix type filtering
use entry type for arrays and member type for member variables

* fix failing tests
use regular expressions to only check the functions of interest and
ignore other parts of the output

* Add parentheses around tables in lua
Indexing table literals only works with parentheses around them.
Co-authored-by: Frotty <[email protected]>
(commit: 31d097f)
The file was modifiedde.peeeq.wurstscript/src/main/java/de/peeeq/wurstscript/translation/lua/printing/LuaPrinter.java (diff)
The file was modifiedde.peeeq.wurstscript/src/main/java/de/peeeq/wurstio/jassinterpreter/ReflectionNativeProvider.java (diff)
The file was addedde.peeeq.wurstscript/src/test/java/tests/wurstscript/tests/LuaTypecastingTests.java
The file was addedde.peeeq.wurstscript/src/main/java/de/peeeq/wurstio/jassinterpreter/providers/LuaEnsureTypeProvider.java
The file was modifiedde.peeeq.wurstscript/src/test/resources/QuickTestsSuite.xml (diff)
The file was modifiedde.peeeq.wurstscript/src/main/java/de/peeeq/wurstio/CompiletimeFunctionRunner.java (diff)
The file was modifiedde.peeeq.wurstscript/src/test/java/tests/wurstscript/tests/LuaTranslationTests.java (diff)
The file was modifiedde.peeeq.wurstscript/src/main/java/de/peeeq/wurstscript/translation/imtranslation/ExprTranslation.java (diff)
The file was modifiedde.peeeq.wurstscript/src/main/java/de/peeeq/wurstscript/translation/imtranslation/ImTranslator.java (diff)
The file was modifiedde.peeeq.wurstscript/src/main/java/de/peeeq/wurstscript/translation/lua/translation/LuaTranslator.java (diff)