Changeset View
Changeset View
Standalone View
Standalone View
duchain/helper.cpp
Show First 20 Lines • Show All 440 Lines • ▼ Show 20 Line(s) | 428 | { | |||
---|---|---|---|---|---|
441 | } else if (parameterType->boolType != -1) { | 441 | } else if (parameterType->boolType != -1) { | ||
442 | type = AbstractType::Ptr(new IntegralType(IntegralType::TypeBoolean)); | 442 | type = AbstractType::Ptr(new IntegralType(IntegralType::TypeBoolean)); | ||
443 | } else if (parameterType->floatType != -1) { | 443 | } else if (parameterType->floatType != -1) { | ||
444 | type = AbstractType::Ptr(new IntegralType(IntegralType::TypeFloat)); | 444 | type = AbstractType::Ptr(new IntegralType(IntegralType::TypeFloat)); | ||
445 | } else if (parameterType->intType != -1) { | 445 | } else if (parameterType->intType != -1) { | ||
446 | type = AbstractType::Ptr(new IntegralType(IntegralType::TypeInt)); | 446 | type = AbstractType::Ptr(new IntegralType(IntegralType::TypeInt)); | ||
447 | } else if (parameterType->stringType != -1) { | 447 | } else if (parameterType->stringType != -1) { | ||
448 | type = AbstractType::Ptr(new IntegralType(IntegralType::TypeString)); | 448 | type = AbstractType::Ptr(new IntegralType(IntegralType::TypeString)); | ||
449 | } else if (parameterType->iterableType != -1) { | ||||
450 | DeclarationPointer traversableDecl = findDeclarationImportHelper(currentContext, QualifiedIdentifier("traversable"), ClassDeclarationType); | ||||
451 | | ||||
452 | if (traversableDecl) { | ||||
453 | UnsureType::Ptr unsure(new UnsureType()); | ||||
454 | AbstractType::Ptr arrayType = AbstractType::Ptr(new IntegralType(IntegralType::TypeArray)); | ||||
455 | unsure->addType(arrayType->indexed()); | ||||
456 | unsure->addType(traversableDecl->abstractType()->indexed()); | ||||
457 | | ||||
458 | type = AbstractType::Ptr(unsure); | ||||
459 | } | ||||
449 | } | 460 | } | ||
450 | 461 | | |||
451 | if (type && parameterType->isNullable != -1) { | 462 | if (type && parameterType->isNullable != -1) { | ||
452 | AbstractType::Ptr nullType = AbstractType::Ptr(new IntegralType(IntegralType::TypeNull)); | 463 | AbstractType::Ptr nullType = AbstractType::Ptr(new IntegralType(IntegralType::TypeNull)); | ||
453 | if (type.cast<UnsureType>()) { | 464 | if (type.cast<UnsureType>()) { | ||
454 | UnsureType::Ptr unsure = type.cast<UnsureType>(); | 465 | UnsureType::Ptr unsure = type.cast<UnsureType>(); | ||
455 | unsure->addType(nullType->indexed()); | 466 | unsure->addType(nullType->indexed()); | ||
456 | } else { | 467 | } else { | ||
▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines |