Package com.google.dart.engine.ast

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


        if (body.isGenerator()) {
          element.setGenerator(true);
        }

        if (inFunction) {
          Block enclosingBlock = node.getAncestor(Block.class);
          if (enclosingBlock != null) {
            int functionEnd = node.getOffset() + node.getLength();
            int blockEnd = enclosingBlock.getOffset() + enclosingBlock.getLength();
            element.setVisibleRange(functionEnd, blockEnd - functionEnd - 1);
          }
        }

        currentHolder.addFunction(element);
View Full Code Here


    }
    if (body.isGenerator()) {
      element.setGenerator(true);
    }
    if (inFunction) {
      Block enclosingBlock = node.getAncestor(Block.class);
      if (enclosingBlock != null) {
        int functionEnd = node.getOffset() + node.getLength();
        int blockEnd = enclosingBlock.getOffset() + enclosingBlock.getLength();
        element.setVisibleRange(functionEnd, blockEnd - functionEnd - 1);
      }
    }

    FunctionTypeImpl type = new FunctionTypeImpl(element);
View Full Code Here

        variable = new ConstLocalVariableElementImpl(variableName);
      } else {
        variable = new LocalVariableElementImpl(variableName);
      }
      element = variable;
      Block enclosingBlock = node.getAncestor(Block.class);
      int functionEnd = node.getOffset() + node.getLength();
      int blockEnd = enclosingBlock.getOffset() + enclosingBlock.getLength();
      // TODO(brianwilkerson) This isn't right for variables declared in a for loop.
      variable.setVisibleRange(functionEnd, blockEnd - functionEnd - 1);

      currentHolder.addLocalVariable(variable);
      variableName.setStaticElement(element);
View Full Code Here

  @Override
  public Boolean visitTryStatement(TryStatement node) {
    if (nodeExits(node.getBody())) {
      return true;
    }
    Block finallyBlock = node.getFinallyBlock();
    if (nodeExits(finallyBlock)) {
      return true;
    }
    return false;
  }
View Full Code Here

        0,
        iterableSpec.length(),
        iterableOffset);
    // resolve as: for (name in iterable) {}
    DeclaredIdentifier loopVariable = new DeclaredIdentifier(null, null, null, null, varName);
    Block loopBody = new Block(null, new ArrayList<Statement>(), null);
    ForEachStatement loopStatement = new ForEachStatement(
        null,
        null,
        null,
        loopVariable,
View Full Code Here

TOP

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

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.