Rework parsing a bit to handle some cases better.

Disable array parsing for now until creating array types works correctly.
This commit is contained in:
Rene Gollent 2013-04-13 17:23:13 -04:00
parent 501201761b
commit 8598af7ec9
1 changed files with 10 additions and 8 deletions

View File

@ -45,15 +45,15 @@ CppLanguage::ParseTypeExpression(const BString &expression,
parsedName.RemoveAll(" ");
int32 modifierIndex = -1;
for (int32 i = parsedName.Length() - 1; i >= 0; i--) {
if (parsedName[i] == '*' || parsedName[i] == '&')
modifierIndex = i;
}
modifierIndex = parsedName.FindFirst('*');
if (modifierIndex == -1)
modifierIndex = parsedName.FindFirst('&');
if (modifierIndex == -1)
modifierIndex = parsedName.FindFirst('[');
if (modifierIndex >= 0) {
parsedName.CopyInto(baseTypeName, 0, modifierIndex);
parsedName.Remove(0, modifierIndex);
} else
if (modifierIndex >= 0)
parsedName.MoveInto(baseTypeName, 0, modifierIndex);
else
baseTypeName = parsedName;
modifierIndex = parsedName.FindFirst('[');
@ -111,6 +111,7 @@ CppLanguage::ParseTypeExpression(const BString &expression,
_resultType = baseType;
#if 0
if (!arraySpecifier.IsEmpty()) {
ArrayType* arrayType = NULL;
@ -140,6 +141,7 @@ CppLanguage::ParseTypeExpression(const BString &expression,
_resultType = arrayType;
}
#endif
typeRef.Detach();