Examples of rawContents()


Examples of lombok.ast.Block.rawContents()

  }
 
  public Node createBlock(List<Node> statements) {
    Block block = new Block();
    if (statements != null) for (Node s : statements) {
      if (s != null) block.rawContents().addToEnd(s);
    }
   
    return posify(block);
  }
 
View Full Code Here

Examples of lombok.ast.Block.rawContents()

  private void checkForUnreachables(Statement n) {
    Block b = n.upToBlock();
    if (b == null) return;
   
    boolean found = false;
    for (Node s : b.rawContents()) {
      if (found) {
        s.addMessage(error(STATEMENT_UNREACHABLE, "Unreachable code"));
        return;
      }
      if (s == n) found = true;
View Full Code Here

Examples of lombok.ast.Block.rawContents()

    }
   
    @Override public void visitBlock(JCBlock node) {
      Node n;
      Block b = new Block();
      fillList(node.stats, b.rawContents());
      setPos(node, b);
      if (hasFlag(FlagKey.BLOCKS_ARE_INITIALIZERS)) {
        if ((node.flags & Flags.STATIC) != 0) {
          n = setPos(node, new StaticInitializer().astBody(b));
        } else {
View Full Code Here

Examples of lombok.ast.Block.rawContents()

      if (hasFlag(FlagKey.BLOCKS_ARE_INITIALIZERS)) {
        if ((node.flags & Flags.STATIC) != 0) {
          n = setPos(node, new StaticInitializer().astBody(b));
        } else {
          // For some strange reason, solitary ; in a type body are represented not as JCSkips, but as JCBlocks with no endpos. Don't ask me why!
          if (b.rawContents().isEmpty() && node.endpos == -1) {
            n = setPos(node, new EmptyDeclaration());
          } else {
            n = setPos(node, new InstanceInitializer().astBody(b));
          }
        }
View Full Code Here

Examples of lombok.ast.Block.rawContents()

      }
      List<JCStatement> initializers = node.getInitializer();
      // Multiple vardefs in a row need to trigger the JCVD version AND be washed through fillList to be turned into 1 VD.
      if (!initializers.isEmpty() && initializers.get(0) instanceof JCVariableDecl) {
        Block tmp = new Block();
        fillList(initializers, tmp.rawContents(), FlagKey.VARDEF_IS_DEFINITION);
        Node varDecl = tmp.rawContents().first();
        if (varDecl != null) varDecl.unparent();
        f.rawVariableDeclaration(varDecl);
      } else {
        for (JCStatement init : initializers) {
View Full Code Here

Examples of lombok.ast.Block.rawContents()

      List<JCStatement> initializers = node.getInitializer();
      // Multiple vardefs in a row need to trigger the JCVD version AND be washed through fillList to be turned into 1 VD.
      if (!initializers.isEmpty() && initializers.get(0) instanceof JCVariableDecl) {
        Block tmp = new Block();
        fillList(initializers, tmp.rawContents(), FlagKey.VARDEF_IS_DEFINITION);
        Node varDecl = tmp.rawContents().first();
        if (varDecl != null) varDecl.unparent();
        f.rawVariableDeclaration(varDecl);
      } else {
        for (JCStatement init : initializers) {
          if (init instanceof JCExpressionStatement) {
View Full Code Here

Examples of lombok.ast.Block.rawContents()

      s.rawCondition(toTree(removeParens(cond)));
      Block b = new Block();
      s.astBody(b);
      for (JCCase c : node.getCases()) {
        JCExpression rawExpr = c.getExpression();
        if (rawExpr == null) b.rawContents().addToEnd(setPos(c, new Default()));
        else b.rawContents().addToEnd(setPos(c, new Case().rawCondition(toTree(rawExpr))));
        fillList(c.getStatements(), b.rawContents());
      }
      set(node, s);
    }
View Full Code Here

Examples of lombok.ast.Block.rawContents()

      Block b = new Block();
      s.astBody(b);
      for (JCCase c : node.getCases()) {
        JCExpression rawExpr = c.getExpression();
        if (rawExpr == null) b.rawContents().addToEnd(setPos(c, new Default()));
        else b.rawContents().addToEnd(setPos(c, new Case().rawCondition(toTree(rawExpr))));
        fillList(c.getStatements(), b.rawContents());
      }
      set(node, s);
    }
   
View Full Code Here

Examples of lombok.ast.Block.rawContents()

      s.astBody(b);
      for (JCCase c : node.getCases()) {
        JCExpression rawExpr = c.getExpression();
        if (rawExpr == null) b.rawContents().addToEnd(setPos(c, new Default()));
        else b.rawContents().addToEnd(setPos(c, new Case().rawCondition(toTree(rawExpr))));
        fillList(c.getStatements(), b.rawContents());
      }
      set(node, s);
    }
   
    @Override public void visitSynchronized(JCSynchronized node) {
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.