mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-04 20:15:16 +00:00
Adjusts formatting when parsing for object and function definitions in the project importer to be more accurate
Adds handling for progrommatic new object delcarations where the class type is defined via () encapsulated code so the project import doesn't mangle it.
This commit is contained in:
parent
10c3188171
commit
8d8432115b
1 changed files with 12 additions and 4 deletions
|
|
@ -476,7 +476,7 @@ function preprocessImportingFiles()
|
|||
{
|
||||
%line = $ProjectImporter::fileObject.readLine();
|
||||
|
||||
if(strIsMatchExpr("* new*(*)*", %line))
|
||||
if(strIsMatchExpr("*new *(*)*", %line))
|
||||
{
|
||||
%start = strpos(%line, "new ");
|
||||
%end = strpos(%line, "(", %start);
|
||||
|
|
@ -486,6 +486,14 @@ function preprocessImportingFiles()
|
|||
%className = getSubStr(%line, %start + 4, %end-%start-4);
|
||||
}
|
||||
|
||||
if(%className $= "")
|
||||
{
|
||||
//we clearly have some unusual formatting, potentially a progromattic
|
||||
//object block creation going on here. so we'll just skip it and move on
|
||||
%currentFileSectionObject.add(%line);
|
||||
continue;
|
||||
}
|
||||
|
||||
%nameEnd = strpos(%line, ")", %end);
|
||||
|
||||
%objectName = getSubStr(%line, %end+1, %nameEnd-%end-1);
|
||||
|
|
@ -530,7 +538,7 @@ function preprocessImportingFiles()
|
|||
%insideObjectBlock = true;
|
||||
}
|
||||
}
|
||||
else if(strIsMatchExpr("* datablock*(*)*", %line))
|
||||
else if(strIsMatchExpr("*datablock *(*)*", %line))
|
||||
{
|
||||
%start = strpos(%line, "datablock ");
|
||||
%end = strpos(%line, "(", %start);
|
||||
|
|
@ -584,7 +592,7 @@ function preprocessImportingFiles()
|
|||
%insideObjectBlock = true;
|
||||
}
|
||||
}
|
||||
else if(strIsMatchExpr("* singleton*(*)*", %line))
|
||||
else if(strIsMatchExpr("*singleton *(*)*", %line))
|
||||
{
|
||||
%start = strpos(%line, "singleton ");
|
||||
%end = strpos(%line, "(", %start);
|
||||
|
|
@ -638,7 +646,7 @@ function preprocessImportingFiles()
|
|||
%insideObjectBlock = true;
|
||||
}
|
||||
}
|
||||
else if(strIsMatchExpr("*function*(*)*", %line))
|
||||
else if(strIsMatchExpr("*function *(*)*", %line))
|
||||
{
|
||||
%start = strpos(%line, "function ");
|
||||
%end = strpos(%line, "(", %start);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue