Package com.google.dart.engine.ast

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


    // binary expression.
    // TODO(jwren) Do we want to take constant expressions into account, evaluate if(false) {}
    // differently than if(<condition>), when <condition> evaluates to a constant false value?
    if (operatorType == TokenType.BAR_BAR) {
      if (lhsExpression instanceof BooleanLiteral) {
        BooleanLiteral booleanLiteral = (BooleanLiteral) lhsExpression;
        if (!booleanLiteral.getValue()) {
          return false;
        }
      }
    }
    // If the operator is && and the left hand side is true literal, don't consider the RHS of the
    // binary expression.
    if (operatorType == TokenType.AMPERSAND_AMPERSAND) {
      if (lhsExpression instanceof BooleanLiteral) {
        BooleanLiteral booleanLiteral = (BooleanLiteral) lhsExpression;
        if (booleanLiteral.getValue()) {
          return false;
        }
      }
    }
    Expression rhsExpression = node.getRightOperand();
View Full Code Here


      if (nodeExits(conditionExpression)) {
        return true;
      }
      // TODO(jwren) Do we want to take all constant expressions into account?
      if (conditionExpression instanceof BooleanLiteral) {
        BooleanLiteral booleanLiteral = (BooleanLiteral) conditionExpression;
        // If do {} while (true), and the body doesn't return or the body doesn't have a break, then
        // return true.
        boolean blockReturns = nodeExits(node.getBody());
        if (booleanLiteral.getValue() && (blockReturns || !enclosingBlockContainsBreak)) {
          return true;
        }
      }
      return false;
    } finally {
View Full Code Here

    if (nodeExits(conditionExpression)) {
      return true;
    }
    // TODO(jwren) Do we want to take all constant expressions into account?
    if (conditionExpression instanceof BooleanLiteral) {
      BooleanLiteral booleanLiteral = (BooleanLiteral) conditionExpression;
      if (booleanLiteral.getValue()) {
        // if(true) ...
        return nodeExits(thenStatement);
      } else if (elseStatement != null) {
        // if (false) ...
        return nodeExits(elseStatement);
View Full Code Here

      if (conditionExpression.accept(this)) {
        return true;
      }
      // TODO(jwren) Do we want to take all constant expressions into account?
      if (conditionExpression instanceof BooleanLiteral) {
        BooleanLiteral booleanLiteral = (BooleanLiteral) conditionExpression;
        // If while(true), and the body doesn't return or the body doesn't have a break, then return
        // true.
        boolean blockReturns = node.getBody().accept(this);
        if (booleanLiteral.getValue() && (blockReturns || !enclosingBlockContainsBreak)) {
          return true;
        }
      }
      return false;
    } finally {
View Full Code Here

TOP

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

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.