use of org.mozilla.javascript.ast.WithStatement in project HL4A by HL4A.
the class Parser method withStatement.
private WithStatement withStatement() throws IOException {
if (currentToken != Token.WITH)
codeBug();
consumeToken();
Comment withComment = getAndResetJsDoc();
int lineno = ts.lineno, pos = ts.tokenBeg, lp = -1, rp = -1;
if (mustMatchToken(Token.LP, "msg.no.paren.with"))
lp = ts.tokenBeg;
AstNode obj = expr();
if (mustMatchToken(Token.RP, "msg.no.paren.after.with"))
rp = ts.tokenBeg;
AstNode body = statement();
WithStatement pn = new WithStatement(pos, getNodeEnd(body) - pos);
pn.setJsDocNode(withComment);
pn.setExpression(obj);
pn.setStatement(body);
pn.setParens(lp, rp);
pn.setLineno(lineno);
return pn;
}
Aggregations