Hello! When compiling a script using CScriptBuilder, the program crashes because the script engine does not find the required function when parsing metadata. Here is an example script code:
namespace Base::Nested
{
[metadata]
void do_something()
{
}
}
The problem is that CScriptBuilder can't parse the namespace correctly, and only Base is used instead of Base::Nested. Here is a piece of code from scriptbuilder.cpp that I don't think is working correctly:
// Get the identifier after "namespace"
do
{
pos += len;
t = engine->ParseToken(&modifiedScript[pos], modifiedScript.size() - pos, &len);
} while (t == asTC_COMMENT || t == asTC_WHITESPACE);
if (currentNamespace != "")
currentNamespace += "::";
currentNamespace += modifiedScript.substr(pos, len);
Maybe it should be replaced with something like this? Thank you!
// Get the identifier after "namespace"
do
{
do
{
pos += len;
t = engine->ParseToken(&modifiedScript[pos], modifiedScript.size() - pos, &len);
} while (t == asTC_COMMENT || t == asTC_WHITESPACE);
if (t == asTC_IDENTIFIER)
{
if (currentNamespace != "")
currentNamespace += "::";
currentNamespace += modifiedScript.substr(pos, len);
}
} while (t == asTC_IDENTIFIER || (t == asTC_KEYWORD && modifiedScript.substr(pos, len) == "::"));