222223224225226227228
readToken(Token.KEYWORD_WHILE); readToken(Token.OPERATOR_OPENPAREN); expression = parseExpression(true); readToken(Token.OPERATOR_CLOSEPAREN); return new DoStatement(statement, expression); }
3334353637383940414243444546474849505152
super(name); } public void testDoStatement() throws CompilerException { assertParserOutput( new DoStatement( new ExpressionStatement( new Identifier("something") ), new BooleanLiteral(true) ), "do something; while (true);" ); assertParserOutput( new DoStatement( new BlockStatement( new Statement[] { new ExpressionStatement( new Identifier("something") )