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