com.google.caja.parser.js.LabeledStmtWrapper

Here are the examples of the java api class com.google.caja.parser.js.LabeledStmtWrapper taken from open source projects.

1. ParseTreeNodeTest#setUp()

Project: caja
Source File: ParseTreeNodeTest.java
View license
@Override
protected void setUp() throws Exception {
    super.setUp();
    FilePosition unk = FilePosition.UNKNOWN;
    // $0: {
    //   $1: {
    //     2;
    //     3;
    //     4;
    //   }
    //   $5: {
    //     6;
    //     7;
    //     8;
    //   }
    // }
    // $9: {
    //   10;
    //   11;
    //   12;
    // }
    ExpressionStmt[] b = new ExpressionStmt[13];
    for (int i = b.length; --i >= 0; ) {
        b[i] = new ExpressionStmt(unk, new IntegerLiteral(unk, i));
    }
    LabeledStmtWrapper b1 = new LabeledStmtWrapper(unk, "$1", new Block(unk, Arrays.asList(b[2], b[3], b[4])));
    LabeledStmtWrapper b5 = new LabeledStmtWrapper(unk, "$5", new Block(unk, Arrays.asList(b[6], b[7], b[8])));
    root = new LabeledStmtWrapper(unk, "$0", new Block(unk, Arrays.asList(b1, b5)));
    b9 = new LabeledStmtWrapper(unk, "$9", new Block(unk, Arrays.asList(b[10], b[11], b[12])));
}