Examples of HaxeType


Examples of com.intellij.plugins.haxe.lang.psi.HaxeType

      final Map<String, List<HaxeClassInfo>> result = new THashMap<String, List<HaxeClassInfo>>(classes.size());
      final Map<String, String> qNameCache = new THashMap<String, String>();
      for (AbstractHaxeTypeDefImpl haxeTypeDef : classes) {
        final HaxeClassInfo value = new HaxeClassInfo(haxeTypeDef.getQualifiedName(), HaxeComponentType.typeOf(haxeTypeDef));
        final HaxeTypeOrAnonymous haxeTypeOrAnonymous = haxeTypeDef.getTypeOrAnonymous();
        final HaxeType type = haxeTypeOrAnonymous == null ? null : haxeTypeOrAnonymous.getType();
        final HaxeAnonymousType anonymousType = haxeTypeOrAnonymous == null ? null : haxeTypeOrAnonymous.getAnonymousType();
        if (anonymousType != null) {
          final HaxeTypeExtends typeExtends = anonymousType.getAnonymousTypeBody().getTypeExtends();
          if (typeExtends != null) {
            final String classNameCandidate = typeExtends.getType().getText();
            final String key = classNameCandidate.indexOf('.') != -1 ?
                               classNameCandidate :
                               getQNameAndCache(qNameCache, fileChildren, classNameCandidate);
            put(result, key, value);
          }
        }
        else if (type != null) {
          final String classNameCandidate = type.getText();
          final String qName = classNameCandidate.indexOf('.') != -1 ?
                               classNameCandidate :
                               getQNameAndCache(qNameCache, fileChildren, classNameCandidate);
          put(result, qName, value);
        }
View Full Code Here

Examples of com.intellij.plugins.haxe.lang.psi.HaxeType

  }

  public void doTest() {
    final PsiFile file = PsiDocumentManager.getInstance(myFixture.getProject()).getPsiFile(myFixture.getEditor().getDocument());
    assertNotNull(file);
    final HaxeType type = PsiTreeUtil.getParentOfType(file.findElementAt(myFixture.getCaretOffset()), HaxeType.class, false);
    assertNotNull(type);
    final GlobalSearchScope scope = HaxeResolveUtil.getScopeForElement(type);
    new HaxeTypeAddImportIntentionAction(type, HaxeComponentIndex
      .getItemsByName(type.getReferenceExpression().getText(), type.getProject(), scope))
      .execute();
    myFixture.checkResultByFile(getTestName(false) + ".txt");
  }
View Full Code Here

Examples of tree.type.HaxeType

    {
        HaxeTree tree = parseModule("class A { function main():Int { return 123.1;}}");
        linker.visit(tree, new Environment());
       
        Return returnNode = getReturnNode(tree);
        HaxeType type = returnNode.getHaxeType();
        Function function = returnNode.getFunction();   
        HaxeType funType = function.getHaxeType();
       
        assertTrue(!TypeUtils.isAvailableAssignement(funType, type));
    }
View Full Code Here

Examples of tree.type.HaxeType

    {
        HaxeTree tree = parseModule("class A { function main():Float { return 123;}}");
        linker.visit(tree, new Environment());
       
        Return returnNode = getReturnNode(tree);
        HaxeType type = returnNode.getHaxeType();
        Function function = returnNode.getFunction();
        HaxeType funType = function.getHaxeType();
       
        assertTrue(TypeUtils.isAvailableAssignement(funType, type));
    }
View Full Code Here

Examples of tree.type.HaxeType

        HaxeTree initialization = node.getInitializationNode();
        if (initialization == null)
        {
            return;
        }
        HaxeType type = node.getHaxeType();
        HaxeType initType = initialization.getHaxeType(true);
        if (type == null || initType == null)
        {
            return;
        }
        if (!TypeUtils.isAvailableAssignement(type, initType))
View Full Code Here

Examples of tree.type.HaxeType

        }
       
        for (HaxeTree child : node.getParameters())
        {
            visit(child, data);
            HaxeType ctype = child.getHaxeType(true);
            if (!ctype.equals(TypeUtils.getInt()))
            {
                ErrorPublisher.commitCastError(child, TypeUtils.getInt());
            }
        }
       
View Full Code Here

Examples of tree.type.HaxeType

            // some member's type was undefined
            return;
        }
        // here we have...member's types are not from the same
        // hierarchy!
        HaxeType type = TypeUtils.getUnknown();
        for (HaxeTree child : node.getChildren())
        {
            HaxeType ctype = child.getHaxeType(true);
            if (child.getChildIndex() == 0)
            {
                type = ctype;
                continue;
            }
View Full Code Here

Examples of tree.type.HaxeType

    }

    @Override
    protected void visit(final Return node, Object data)
    {
        HaxeType type = node.getHaxeType();
        Function function = node.getFunction();
       
        HaxeType funType = function == null
                ? TypeUtils.getVoid() : function.getHaxeType();
        if (!TypeUtils.isAvailableAssignement(funType, type))
        {
            ErrorPublisher.commitCastError(node, funType);
        }
View Full Code Here

Examples of tree.type.HaxeType

        {
            visit(condition, data);
            return;
        }

        HaxeType bool = TypeUtils.getBool();
        if (!condition.getHaxeType().equals(bool))
        {
            ErrorPublisher.commitCastError(condition, bool);
        }
    }
View Full Code Here

Examples of tree.type.HaxeType

        {
            return type1;
        }
       
        // we have to look their hierarchies deeper
        HaxeType typeFromHierarhy = null;
        for (HaxeType type : type1Hierarchy)
        {
            typeFromHierarhy = getCommonPrimaryType(type, type2);
        }
       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.