Package com.google.dart.engine.ast

Examples of com.google.dart.engine.ast.IsExpression


   * @return {@code true} if the given type name is used as the type in an is expression
   */
  private boolean isTypeNameInIsExpression(TypeName typeName) {
    AstNode parent = typeName.getParent();
    if (parent instanceof IsExpression) {
      IsExpression isExpression = (IsExpression) parent;
      return isExpression.getType() == typeName;
    }
    return false;
  }
View Full Code Here


        promoteTypes(left);
        promoteTypes(right);
        clearTypePromotionsIfPotentiallyMutatedIn(right);
      }
    } else if (condition instanceof IsExpression) {
      IsExpression is = (IsExpression) condition;
      if (is.getNotOperator() == null) {
        promote(is.getExpression(), is.getType().getType());
      }
    } else if (condition instanceof ParenthesizedExpression) {
      promoteTypes(((ParenthesizedExpression) condition).getExpression());
    }
  }
View Full Code Here

      if (binary.getOperator().getType() == TokenType.BAR_BAR) {
        propagateFalseState(binary.getLeftOperand());
        propagateFalseState(binary.getRightOperand());
      }
    } else if (condition instanceof IsExpression) {
      IsExpression is = (IsExpression) condition;
      if (is.getNotOperator() != null) {
        // Since an is-statement doesn't actually change the type, we don't
        // let it affect the propagated type when it would result in a loss
        // of precision.
        overrideExpression(is.getExpression(), is.getType().getType(), false);
      }
    } else if (condition instanceof PrefixExpression) {
      PrefixExpression prefix = (PrefixExpression) condition;
      if (prefix.getOperator().getType() == TokenType.BANG) {
        propagateTrueState(prefix.getOperand());
View Full Code Here

      if (binary.getOperator().getType() == TokenType.AMPERSAND_AMPERSAND) {
        propagateTrueState(binary.getLeftOperand());
        propagateTrueState(binary.getRightOperand());
      }
    } else if (condition instanceof IsExpression) {
      IsExpression is = (IsExpression) condition;
      if (is.getNotOperator() == null) {
        // Since an is-statement doesn't actually change the type, we don't
        // let it affect the propagated type when it would result in a loss
        // of precision.
        overrideExpression(is.getExpression(), is.getType().getType(), false);
      }
    } else if (condition instanceof PrefixExpression) {
      PrefixExpression prefix = (PrefixExpression) condition;
      if (prefix.getOperator().getType() == TokenType.BANG) {
        propagateFalseState(prefix.getOperand());
View Full Code Here

TOP

Related Classes of com.google.dart.engine.ast.IsExpression

Copyright © 2018 www.massapicom. 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.