use of org.mozilla.javascript.ast.DoLoop in project st-js by st-js.
the class RhinoJavaScriptBuilder method doLoop.
/**
* {@inheritDoc}
*/
@Override
public AstNode doLoop(AstNode condition, AstNode body) {
DoLoop loop = new DoLoop();
loop.setCondition(condition);
loop.setBody(body);
return loop;
}
use of org.mozilla.javascript.ast.DoLoop in project HL4A by HL4A.
the class Parser method doLoop.
private DoLoop doLoop() throws IOException {
if (currentToken != Token.DO)
codeBug();
consumeToken();
int pos = ts.tokenBeg, end;
DoLoop pn = new DoLoop(pos);
pn.setLineno(ts.lineno);
enterLoop(pn);
try {
AstNode body = statement();
mustMatchToken(Token.WHILE, "msg.no.while.do");
pn.setWhilePosition(ts.tokenBeg - pos);
ConditionData data = condition();
pn.setCondition(data.condition);
pn.setParens(data.lp - pos, data.rp - pos);
end = getNodeEnd(body);
pn.setBody(body);
} finally {
exitLoop();
}
// world, see bug 238945
if (matchToken(Token.SEMI)) {
end = ts.tokenEnd;
}
pn.setLength(end - pos);
return pn;
}