Examples of ForinStatement


Examples of com.google.minijoe.compiler.ast.ForInStatement

          readToken(Token.KEYWORD_IN);
          expression = parseExpression(true);
          readToken(Token.OPERATOR_CLOSEPAREN);

          // 'for' '(' ... 'in' ... ')' Statement
          statement = new ForInStatement(variable, expression, parseStatement());
          break;

        case 4:
          // 'for' '(' 'var' VariableDeclarationList
          Vector declarationVector = new Vector();
View Full Code Here

Examples of com.google.minijoe.compiler.ast.ForInStatement

    super(name);
  }

  public void testForInStatement() throws CompilerException {
    assertParserOutput(
        new ForInStatement(
            new Identifier("foo"),
            new ArrayLiteral(
                new Expression[] {
                    new NumberLiteral(1.0),
                    new NumberLiteral(2.0),
                    new NumberLiteral(3.0),
                    new NumberLiteral(4.0)
                }
            ),
            new EmptyStatement()
        ),
        "for (foo in [1, 2, 3, 4]);"
    );
    assertParserOutput(
        new ForInStatement(
            new PropertyExpression(
                new Identifier("foo"),
                new StringLiteral("bar")
            ),
            new ArrayLiteral(
                new Expression[] {
                    new NumberLiteral(1.0),
                    new NumberLiteral(2.0),
                    new NumberLiteral(3.0),
                    new NumberLiteral(4.0)
                }
            ),
            new EmptyStatement()
        ),
        "for (foo.bar in [1, 2, 3, 4]);"
    );
    assertParserOutput(
        new ForInStatement(
            new VariableDeclaration(
                new Identifier("foo"),
                null
            ),
            new ArrayLiteral(
View Full Code Here

Examples of org.lilystudio.javascript.statement.ForinStatement

      return new LoopStatement(node, root, scope);

    case Token.LOCAL_BLOCK: {
      switch (node.getFirstChild().getType()) {
      case Token.LOOP:
        return new ForinStatement(node, root, scope);
      case Token.TRY:
        return new TryStatement(node, root, scope);
      default:
        throw new RuntimeException(node.getFirstChild().getType() + "");
      }
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.