本文整理了Java中org.mozilla.javascript.Parser.markDestructuring()
方法的一些代码示例,展示了Parser.markDestructuring()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Parser.markDestructuring()
方法的具体详情如下:
包路径:org.mozilla.javascript.Parser
类名称:Parser
方法名:markDestructuring
暂无
代码示例来源:origin: io.apigee/rhino
void markDestructuring(AstNode node) {
if (node instanceof DestructuringForm) {
((DestructuringForm)node).setIsDestructuring(true);
} else if (node instanceof ParenthesizedExpression) {
markDestructuring(((ParenthesizedExpression)node).getExpression());
}
}
代码示例来源:origin: ro.isdc.wro4j/rhino
void markDestructuring(AstNode node) {
if (node instanceof DestructuringForm) {
((DestructuringForm)node).setIsDestructuring(true);
} else if (node instanceof ParenthesizedExpression) {
markDestructuring(((ParenthesizedExpression)node).getExpression());
}
}
代码示例来源:origin: com.github.tntim96/rhino
void markDestructuring(AstNode node) {
if (node instanceof DestructuringForm) {
((DestructuringForm)node).setIsDestructuring(true);
} else if (node instanceof ParenthesizedExpression) {
markDestructuring(((ParenthesizedExpression)node).getExpression());
}
}
代码示例来源:origin: geogebra/geogebra
void markDestructuring(AstNode node) {
if (node instanceof DestructuringForm) {
((DestructuringForm)node).setIsDestructuring(true);
} else if (node instanceof ParenthesizedExpression) {
markDestructuring(((ParenthesizedExpression)node).getExpression());
}
}
代码示例来源:origin: ro.isdc.wro4j/rhino
private AstNode forLoopInit(int tt) throws IOException {
try {
inForInit = true; // checked by variables() and relExpr()
AstNode init = null;
if (tt == Token.SEMI) {
init = new EmptyExpression(ts.tokenBeg, 1);
init.setLineno(ts.lineno);
} else if (tt == Token.VAR || tt == Token.LET) {
consumeToken();
init = variables(tt, ts.tokenBeg, false);
} else {
init = expr();
markDestructuring(init);
}
return init;
} finally {
inForInit = false;
}
}
代码示例来源:origin: io.apigee/rhino
private AstNode forLoopInit(int tt) throws IOException {
try {
inForInit = true; // checked by variables() and relExpr()
AstNode init = null;
if (tt == Token.SEMI) {
init = new EmptyExpression(ts.tokenBeg, 1);
init.setLineno(ts.lineno);
} else if (tt == Token.VAR || tt == Token.LET) {
consumeToken();
init = variables(tt, ts.tokenBeg, false);
} else {
init = expr();
markDestructuring(init);
}
return init;
} finally {
inForInit = false;
}
}
代码示例来源:origin: geogebra/geogebra
private AstNode forLoopInit(int tt) throws IOException {
try {
inForInit = true; // checked by variables() and relExpr()
AstNode init = null;
if (tt == Token.SEMI) {
init = new EmptyExpression(ts.tokenBeg, 1);
init.setLineno(ts.lineno);
} else if (tt == Token.VAR || tt == Token.LET) {
consumeToken();
init = variables(tt, ts.tokenBeg, false);
} else {
init = expr();
markDestructuring(init);
}
return init;
} finally {
inForInit = false;
}
}
代码示例来源:origin: com.github.tntim96/rhino
private AstNode forLoopInit(int tt) throws IOException {
try {
inForInit = true; // checked by variables() and relExpr()
AstNode init = null;
if (tt == Token.SEMI) {
init = new EmptyExpression(ts.tokenBeg, 1);
init.setLineno(ts.lineno);
} else if (tt == Token.VAR || tt == Token.LET) {
consumeToken();
init = variables(tt, ts.tokenBeg, false);
} else {
init = expr();
markDestructuring(init);
}
return init;
} finally {
inForInit = false;
}
}
代码示例来源:origin: com.github.tntim96/rhino
if (tt == Token.LB || tt == Token.LC) {
AstNode expr = destructuringPrimaryExpr();
markDestructuring(expr);
fnNode.addParam(expr);
代码示例来源:origin: geogebra/geogebra
private AstNode assignExpr()
throws IOException
{
int tt = peekToken();
if (tt == Token.YIELD) {
return returnOrYield(tt, true);
}
AstNode pn = condExpr();
tt = peekToken();
if (Token.FIRST_ASSIGN <= tt && tt <= Token.LAST_ASSIGN) {
consumeToken();
// Pull out JSDoc info and reset it before recursing.
Comment jsdocNode = getAndResetJsDoc();
markDestructuring(pn);
int opPos = ts.tokenBeg;
pn = new Assignment(tt, pn, assignExpr(), opPos);
if (jsdocNode != null) {
pn.setJsDocNode(jsdocNode);
}
} else if (tt == Token.SEMI) {
// This may be dead code added intentionally, for JSDoc purposes.
// For example: /** @type Number */ C.prototype.x;
if (currentJsDocComment != null) {
pn.setJsDocNode(getAndResetJsDoc());
}
}
return pn;
}
代码示例来源:origin: io.apigee/rhino
private AstNode assignExpr()
throws IOException
{
int tt = peekToken();
if (tt == Token.YIELD) {
return returnOrYield(tt, true);
}
AstNode pn = condExpr();
tt = peekToken();
if (Token.FIRST_ASSIGN <= tt && tt <= Token.LAST_ASSIGN) {
consumeToken();
// Pull out JSDoc info and reset it before recursing.
Comment jsdocNode = getAndResetJsDoc();
markDestructuring(pn);
int opPos = ts.tokenBeg;
pn = new Assignment(tt, pn, assignExpr(), opPos);
if (jsdocNode != null) {
pn.setJsDocNode(jsdocNode);
}
} else if (tt == Token.SEMI) {
// This may be dead code added intentionally, for JSDoc purposes.
// For example: /** @type Number */ C.prototype.x;
if (currentJsDocComment != null) {
pn.setJsDocNode(getAndResetJsDoc());
}
}
return pn;
}
代码示例来源:origin: ro.isdc.wro4j/rhino
private AstNode assignExpr()
throws IOException
{
int tt = peekToken();
if (tt == Token.YIELD) {
return returnOrYield(tt, true);
}
AstNode pn = condExpr();
tt = peekToken();
if (Token.FIRST_ASSIGN <= tt && tt <= Token.LAST_ASSIGN) {
consumeToken();
// Pull out JSDoc info and reset it before recursing.
Comment jsdocNode = getAndResetJsDoc();
markDestructuring(pn);
int opPos = ts.tokenBeg;
pn = new Assignment(tt, pn, assignExpr(), opPos);
if (jsdocNode != null) {
pn.setJsDocNode(jsdocNode);
}
} else if (tt == Token.SEMI) {
// This may be dead code added intentionally, for JSDoc purposes.
// For example: /** @type Number */ C.prototype.x;
if (currentJsDocComment != null) {
pn.setJsDocNode(getAndResetJsDoc());
}
}
return pn;
}
代码示例来源:origin: com.github.tntim96/rhino
private AstNode assignExpr()
throws IOException
{
int tt = peekToken();
if (tt == Token.YIELD) {
return returnOrYield(tt, true);
}
AstNode pn = condExpr();
tt = peekToken();
if (Token.FIRST_ASSIGN <= tt && tt <= Token.LAST_ASSIGN) {
consumeToken();
// Pull out JSDoc info and reset it before recursing.
Comment jsdocNode = getAndResetJsDoc();
markDestructuring(pn);
int opPos = ts.tokenBeg;
pn = new Assignment(tt, pn, assignExpr(), opPos);
if (jsdocNode != null) {
pn.setJsDocNode(jsdocNode);
}
} else if (tt == Token.SEMI) {
// This may be dead code added intentionally, for JSDoc purposes.
// For example: /** @type Number */ C.prototype.x;
if (currentJsDocComment != null) {
pn.setJsDocNode(getAndResetJsDoc());
}
}
return pn;
}
代码示例来源:origin: com.github.tntim96/rhino
markDestructuring(iter);
break;
case Token.NAME:
代码示例来源:origin: geogebra/geogebra
if (!(destructuring instanceof DestructuringForm))
reportError("msg.bad.assign.left", kidPos, end - kidPos);
markDestructuring(destructuring);
} else {
代码示例来源:origin: io.apigee/rhino
markDestructuring(iter);
break;
case Token.NAME:
代码示例来源:origin: geogebra/geogebra
markDestructuring(iter);
break;
case Token.NAME:
代码示例来源:origin: com.github.tntim96/rhino
markDestructuring(iter);
break;
case Token.NAME:
代码示例来源:origin: io.apigee/rhino
markDestructuring(iter);
break;
case Token.NAME:
代码示例来源:origin: ro.isdc.wro4j/rhino
markDestructuring(iter);
break;
case Token.NAME:
内容来源于网络,如有侵权,请联系作者删除!