Changeset View
Changeset View
Standalone View
Standalone View
duchain/helper.cpp
Show First 20 Lines • Show All 103 Lines • ▼ Show 20 Line(s) | 97 | } else if (genericType->genericType) { | |||
---|---|---|---|---|---|
104 | } else if (typehint.compare(QLatin1String("float"), Qt::CaseInsensitive) == 0) { | 104 | } else if (typehint.compare(QLatin1String("float"), Qt::CaseInsensitive) == 0) { | ||
105 | return false; | 105 | return false; | ||
106 | } else if (typehint.compare(QLatin1String("int"), Qt::CaseInsensitive) == 0) { | 106 | } else if (typehint.compare(QLatin1String("int"), Qt::CaseInsensitive) == 0) { | ||
107 | return false; | 107 | return false; | ||
108 | } else if (typehint.compare(QLatin1String("string"), Qt::CaseInsensitive) == 0) { | 108 | } else if (typehint.compare(QLatin1String("string"), Qt::CaseInsensitive) == 0) { | ||
109 | return false; | 109 | return false; | ||
110 | } else if (typehint.compare(QLatin1String("iterable"), Qt::CaseInsensitive) == 0) { | 110 | } else if (typehint.compare(QLatin1String("iterable"), Qt::CaseInsensitive) == 0) { | ||
111 | return false; | 111 | return false; | ||
112 | } else if (typehint.compare(QLatin1String("object"), Qt::CaseInsensitive) == 0) { | ||||
113 | return false; | ||||
112 | } else { | 114 | } else { | ||
113 | return true; | 115 | return true; | ||
114 | } | 116 | } | ||
115 | } else { | 117 | } else { | ||
116 | return false; | 118 | return false; | ||
117 | } | 119 | } | ||
118 | } | 120 | } | ||
119 | 121 | | |||
▲ Show 20 Lines • Show All 354 Lines • ▼ Show 20 Line(s) | 471 | } else if (genericType->typehint->genericType) { | |||
474 | if (typehint.compare(QLatin1String("bool"), Qt::CaseInsensitive) == 0) { | 476 | if (typehint.compare(QLatin1String("bool"), Qt::CaseInsensitive) == 0) { | ||
475 | type = AbstractType::Ptr(new IntegralType(IntegralType::TypeBoolean)); | 477 | type = AbstractType::Ptr(new IntegralType(IntegralType::TypeBoolean)); | ||
476 | } else if (typehint.compare(QLatin1String("float"), Qt::CaseInsensitive) == 0) { | 478 | } else if (typehint.compare(QLatin1String("float"), Qt::CaseInsensitive) == 0) { | ||
477 | type = AbstractType::Ptr(new IntegralType(IntegralType::TypeFloat)); | 479 | type = AbstractType::Ptr(new IntegralType(IntegralType::TypeFloat)); | ||
478 | } else if (typehint.compare(QLatin1String("int"), Qt::CaseInsensitive) == 0) { | 480 | } else if (typehint.compare(QLatin1String("int"), Qt::CaseInsensitive) == 0) { | ||
479 | type = AbstractType::Ptr(new IntegralType(IntegralType::TypeInt)); | 481 | type = AbstractType::Ptr(new IntegralType(IntegralType::TypeInt)); | ||
480 | } else if (typehint.compare(QLatin1String("string"), Qt::CaseInsensitive) == 0) { | 482 | } else if (typehint.compare(QLatin1String("string"), Qt::CaseInsensitive) == 0) { | ||
481 | type = AbstractType::Ptr(new IntegralType(IntegralType::TypeString)); | 483 | type = AbstractType::Ptr(new IntegralType(IntegralType::TypeString)); | ||
484 | } else if (typehint.compare(QLatin1String("object"), Qt::CaseInsensitive) == 0) { | ||||
485 | type = AbstractType::Ptr(new IntegralTypeExtended(IntegralTypeExtended::TypeObject)); | ||||
482 | } else if (typehint.compare(QLatin1String("iterable"), Qt::CaseInsensitive) == 0) { | 486 | } else if (typehint.compare(QLatin1String("iterable"), Qt::CaseInsensitive) == 0) { | ||
483 | DeclarationPointer traversableDecl = findDeclarationImportHelper(currentContext, QualifiedIdentifier("traversable"), ClassDeclarationType); | 487 | DeclarationPointer traversableDecl = findDeclarationImportHelper(currentContext, QualifiedIdentifier("traversable"), ClassDeclarationType); | ||
484 | 488 | | |||
485 | if (traversableDecl) { | 489 | if (traversableDecl) { | ||
486 | UnsureType::Ptr unsure(new UnsureType()); | 490 | UnsureType::Ptr unsure(new UnsureType()); | ||
487 | AbstractType::Ptr arrayType = AbstractType::Ptr(new IntegralType(IntegralType::TypeArray)); | 491 | AbstractType::Ptr arrayType = AbstractType::Ptr(new IntegralType(IntegralType::TypeArray)); | ||
488 | unsure->addType(arrayType->indexed()); | 492 | unsure->addType(arrayType->indexed()); | ||
489 | unsure->addType(traversableDecl->abstractType()->indexed()); | 493 | unsure->addType(traversableDecl->abstractType()->indexed()); | ||
▲ Show 20 Lines • Show All 109 Lines • Show Last 20 Lines |