Package lombok.ast

Examples of lombok.ast.Node.accept()


   
    Node result = getResult();
    if (javadocs.isEmpty()) return result;
   
    val nodePositions = new TreeMap<Integer, Node>();
    result.accept(new ForwardingAstVisitor() {
      private void addToMap(Node positionNode, Node linked) {
        if (positionNode == null) return;
       
        int start = positionNode.getPosition().getStart();
        if (start == -1) return;
View Full Code Here


      fail(source.getProblems().get(0).toString());
    }
   
    Node node = source.getNodes().get(0);
    PositionCheckingFormatter formatter = new PositionCheckingFormatter(source);
    node.accept(new SourcePrinter(formatter));
    List<AstException> problems = formatter.getProblems();
    try {
      if (!problems.isEmpty()) fail("position error: " + problems.get(0));
    } catch (AssertionError e) {
      System.out.println("-------PARSED-PRINTED:");
View Full Code Here

    try {
      if (!problems.isEmpty()) fail("position error: " + problems.get(0));
    } catch (AssertionError e) {
      System.out.println("-------PARSED-PRINTED:");
      StructureFormatter formatter2 = StructureFormatter.formatterWithPositions();
      node.accept(new SourcePrinter(formatter2));
      System.out.println(formatter2.finish());
      System.out.println("--------------PRINTED:");
      System.out.println(formatter.finish());
      System.out.println("----------------------");
      throw e;
View Full Code Here

    if (!source.getProblems().isEmpty()) {
      fail(source.getProblems().get(0).toString());
    }
   
    Node node = source.getNodes().get(0);
    node.accept(new SyntacticValidityVisitor(true));
    node.accept(new ForwardingAstVisitor() {
      @Override public boolean visitNode(Node node) {
        for (Message m : node.getMessages()) if (m.isError()) {
          fail(String.format("Source: %s[%s]: %s: %s\n", source.getName(), node.getPosition(), node, m.getMessage()));
         
View Full Code Here

      fail(source.getProblems().get(0).toString());
    }
   
    Node node = source.getNodes().get(0);
    node.accept(new SyntacticValidityVisitor(true));
    node.accept(new ForwardingAstVisitor() {
      @Override public boolean visitNode(Node node) {
        for (Message m : node.getMessages()) if (m.isError()) {
          fail(String.format("Source: %s[%s]: %s: %s\n", source.getName(), node.getPosition(), node, m.getMessage()));
         
        }
View Full Code Here

      fail(source.getProblems().get(0).toString());
    }
   
    Node node = source.getNodes().get(0);
    TextFormatter formatter = new TextFormatter();
    node.accept(new SourcePrinter(formatter));
    String actual = fixLineEndings(formatter.finish());
    String original = fixLineEndings(source.getRawInput());
    try {
      assertEquals(original, actual);
    } catch (AssertionError e) {
View Full Code Here

      fail(actual.getProblems().get(0).toString());
    }
   
    Node node = actual.getNodes().get(0);
    TextFormatter formatter = new TextFormatter();
    node.accept(new SourcePrinter(formatter));
    String actualString = formatter.finish();
   
    assertEquals(fixLineEndings(expected), fixLineEndings(actualString));
  }
}
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.