strings that are arguments for a function need to be put into the global string table. PrecompileIdent does this for the function name etc so it pulls from that during compiled eval
while it still remains a good idea to port as many NULL compares and assignments over to nullPtr as feasable, we do still need to sort out how to better support scripted empty, false, and zero assigns for things like objectIDs.
this means we'll need to both fully convert the backend of the parser to support that kind of thing, but also alter most if not all exisiting NULLs. up to and including things like SAFE_DELETE. while that's certainly feasable, given there's aproximatel 400 nullptr assigns/checks prior to this commit, and roughly 1800 of the prior, if it terminates in a script call and not an aip one direct, we'll be dialing that back until such time as fork fully fopcused on converting and resolving any lingering mismatches is completed.
Adds the ability to declare defaults for function arguments
eg
function testFunc(%x = 1, %y = 1)
{
return %x + %y;
}
can now be called as
testFunc(10) and it will return the value of 11.
multiple preloads were failing to return false or mesages on failure of mandatory entries.
clear out redundant isScriptFile definition
fix default order of /scripts/managedData script files
std::move needs to be used with pointers, we werent doing that and so a temp var was being copied onto the heap when it should of stayed on the stack. This caused memory leaks
Namespace Leaks: these leaks would have been freed on app kill but they were still contaminating the log so free em.
Con::shutdown: gGlobablVars again another leak that would of been freed on app kill
AssetManager onRemove should be clearing its lists
Scripting language needs a free for its strings these destructors free after the rule is executed so the data is cached internally and then freed. This may be needed for other types in the union (should not be used on nodes just raw data)
Changed:
if check on vals now return true if the value has a string value
%val = "test me" if(%val) will now return true since %val is not null
Script side:
string checks for "true" and "false" will now be parsed as integer values of 1 and 0.
TEST VIGOUROUSLY
now torquescript will print out a more modern error message with a pointer to the offending character.
Multi line error outputs to be added to this for context
If the statement is a terminating statement on slot assignment (such as %var[%i]++;), the stack has to be popped everytime slot arrays are used regardless of the expression type.
unlike in the straight compile it now case it does in fact need to stick around. read injects the CodeBlock into a management system, so no worries about cleanup
Con::EvalResult CodeBlock::exec -
objectCreationStackIndex needs to be signed as we test if it goes sub-zero
ConsoleValue Namespace::Entry::execute -
compiler yells about returning a temp via std::move
bool TorqueScriptRuntime::executeFile -
report the name of the dso output file, not the source scxript input file