本文整理了Java中org.mozilla.javascript.Parser.generatorExpression()
方法的一些代码示例,展示了Parser.generatorExpression()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Parser.generatorExpression()
方法的具体详情如下:
包路径:org.mozilla.javascript.Parser
类名称:Parser
方法名:generatorExpression
暂无
代码示例来源:origin: geogebra/geogebra
if (peekToken() == Token.FOR) {
try {
result.add(generatorExpression(en, 0, true));
代码示例来源:origin: geogebra/geogebra
private AstNode generatorExpression(AstNode result, int pos, boolean inFunctionParams)
throws IOException
{
List<GeneratorExpressionLoop> loops =
new ArrayList<GeneratorExpressionLoop>();
while (peekToken() == Token.FOR) {
loops.add(generatorExpressionLoop());
}
int ifPos = -1;
ConditionData data = null;
if (peekToken() == Token.IF) {
consumeToken();
ifPos = ts.tokenBeg - pos;
data = condition();
}
if(!inFunctionParams) {
mustMatchToken(Token.RP, "msg.no.paren.let");
}
GeneratorExpression pn = new GeneratorExpression(pos, ts.tokenEnd - pos);
pn.setResult(result);
pn.setLoops(loops);
if (data != null) {
pn.setIfPosition(ifPos);
pn.setFilter(data.condition);
pn.setFilterLp(data.lp - pos);
pn.setFilterRp(data.rp - pos);
}
return pn;
}
代码示例来源:origin: io.apigee/rhino
private AstNode generatorExpression(AstNode result, int pos, boolean inFunctionParams)
throws IOException
{
List<GeneratorExpressionLoop> loops =
new ArrayList<GeneratorExpressionLoop>();
while (peekToken() == Token.FOR) {
loops.add(generatorExpressionLoop());
}
int ifPos = -1;
ConditionData data = null;
if (peekToken() == Token.IF) {
consumeToken();
ifPos = ts.tokenBeg - pos;
data = condition();
}
if(!inFunctionParams) {
mustMatchToken(Token.RP, "msg.no.paren.let");
}
GeneratorExpression pn = new GeneratorExpression(pos, ts.tokenEnd - pos);
pn.setResult(result);
pn.setLoops(loops);
if (data != null) {
pn.setIfPosition(ifPos);
pn.setFilter(data.condition);
pn.setFilterLp(data.lp - pos);
pn.setFilterRp(data.rp - pos);
}
return pn;
}
代码示例来源:origin: io.apigee/rhino
if (peekToken() == Token.FOR) {
try {
result.add(generatorExpression(en, 0, true));
代码示例来源:origin: com.github.tntim96/rhino
private AstNode generatorExpression(AstNode result, int pos, boolean inFunctionParams)
throws IOException
{
List<GeneratorExpressionLoop> loops =
new ArrayList<GeneratorExpressionLoop>();
while (peekToken() == Token.FOR) {
loops.add(generatorExpressionLoop());
}
int ifPos = -1;
ConditionData data = null;
if (peekToken() == Token.IF) {
consumeToken();
ifPos = ts.tokenBeg - pos;
data = condition();
}
if(!inFunctionParams) {
mustMatchToken(Token.RP, "msg.no.paren.let");
}
GeneratorExpression pn = new GeneratorExpression(pos, ts.tokenEnd - pos);
pn.setResult(result);
pn.setLoops(loops);
if (data != null) {
pn.setIfPosition(ifPos);
pn.setFilter(data.condition);
pn.setFilterLp(data.lp - pos);
pn.setFilterRp(data.rp - pos);
}
return pn;
}
代码示例来源:origin: ro.isdc.wro4j/rhino
if (peekToken() == Token.FOR) {
try {
result.add(generatorExpression(en, 0, true));
代码示例来源:origin: ro.isdc.wro4j/rhino
private AstNode generatorExpression(AstNode result, int pos, boolean inFunctionParams)
throws IOException
{
List<GeneratorExpressionLoop> loops =
new ArrayList<GeneratorExpressionLoop>();
while (peekToken() == Token.FOR) {
loops.add(generatorExpressionLoop());
}
int ifPos = -1;
ConditionData data = null;
if (peekToken() == Token.IF) {
consumeToken();
ifPos = ts.tokenBeg - pos;
data = condition();
}
if(!inFunctionParams) {
mustMatchToken(Token.RP, "msg.no.paren.let");
}
GeneratorExpression pn = new GeneratorExpression(pos, ts.tokenEnd - pos);
pn.setResult(result);
pn.setLoops(loops);
if (data != null) {
pn.setIfPosition(ifPos);
pn.setFilter(data.condition);
pn.setFilterLp(data.lp - pos);
pn.setFilterRp(data.rp - pos);
}
return pn;
}
代码示例来源:origin: com.github.tntim96/rhino
if (peekToken() == Token.FOR) {
try {
result.add(generatorExpression(en, 0, true));
代码示例来源:origin: geogebra/geogebra
private AstNode parenExpr() throws IOException {
boolean wasInForInit = inForInit;
inForInit = false;
try {
Comment jsdocNode = getAndResetJsDoc();
int lineno = ts.lineno;
int begin = ts.tokenBeg;
AstNode e = expr();
if (peekToken() == Token.FOR) {
return generatorExpression(e, begin);
}
ParenthesizedExpression pn = new ParenthesizedExpression(e);
if (jsdocNode == null) {
jsdocNode = getAndResetJsDoc();
}
if (jsdocNode != null) {
pn.setJsDocNode(jsdocNode);
}
mustMatchToken(Token.RP, "msg.no.paren");
pn.setLength(ts.tokenEnd - pn.getPosition());
pn.setLineno(lineno);
return pn;
} finally {
inForInit = wasInForInit;
}
}
代码示例来源:origin: com.github.tntim96/rhino
private AstNode parenExpr() throws IOException {
boolean wasInForInit = inForInit;
inForInit = false;
try {
Comment jsdocNode = getAndResetJsDoc();
int lineno = ts.lineno;
int begin = ts.tokenBeg;
AstNode e = expr();
if (peekToken() == Token.FOR) {
return generatorExpression(e, begin);
}
ParenthesizedExpression pn = new ParenthesizedExpression(e);
if (jsdocNode == null) {
jsdocNode = getAndResetJsDoc();
}
if (jsdocNode != null) {
pn.setJsDocNode(jsdocNode);
}
mustMatchToken(Token.RP, "msg.no.paren");
pn.setLength(ts.tokenEnd - pn.getPosition());
pn.setLineno(lineno);
return pn;
} finally {
inForInit = wasInForInit;
}
}
代码示例来源:origin: ro.isdc.wro4j/rhino
private AstNode parenExpr() throws IOException {
boolean wasInForInit = inForInit;
inForInit = false;
try {
Comment jsdocNode = getAndResetJsDoc();
int lineno = ts.lineno;
int begin = ts.tokenBeg;
AstNode e = expr();
if (peekToken() == Token.FOR) {
return generatorExpression(e, begin);
}
ParenthesizedExpression pn = new ParenthesizedExpression(e);
if (jsdocNode == null) {
jsdocNode = getAndResetJsDoc();
}
if (jsdocNode != null) {
pn.setJsDocNode(jsdocNode);
}
mustMatchToken(Token.RP, "msg.no.paren");
pn.setLength(ts.tokenEnd - pn.getPosition());
pn.setLineno(lineno);
return pn;
} finally {
inForInit = wasInForInit;
}
}
代码示例来源:origin: io.apigee/rhino
private AstNode parenExpr() throws IOException {
boolean wasInForInit = inForInit;
inForInit = false;
try {
Comment jsdocNode = getAndResetJsDoc();
int lineno = ts.lineno;
int begin = ts.tokenBeg;
AstNode e = expr();
if (peekToken() == Token.FOR) {
return generatorExpression(e, begin);
}
ParenthesizedExpression pn = new ParenthesizedExpression(e);
if (jsdocNode == null) {
jsdocNode = getAndResetJsDoc();
}
if (jsdocNode != null) {
pn.setJsDocNode(jsdocNode);
}
mustMatchToken(Token.RP, "msg.no.paren");
pn.setLength(ts.tokenEnd - pn.getPosition());
pn.setLineno(lineno);
return pn;
} finally {
inForInit = wasInForInit;
}
}
内容来源于网络,如有侵权,请联系作者删除!