org.mozilla.javascript.Parser.variables()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 JavaScript  
字(5.2k)|赞(0)|评价(0)|浏览(319)

本文整理了Java中org.mozilla.javascript.Parser.variables()方法的一些代码示例,展示了Parser.variables()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Parser.variables()方法的具体详情如下:
包路径:org.mozilla.javascript.Parser
类名称:Parser
方法名:variables

Parser.variables介绍

[英]Parse a 'var' or 'const' statement, or a 'var' init list in a for statement.
[中]解析'var'或'const'语句,或for语句中的'var'init列表。

代码示例

代码示例来源:origin: ro.isdc.wro4j/rhino

private AstNode letStatement()
  throws IOException
{
  if (currentToken != Token.LET) codeBug();
  consumeToken();
  int lineno = ts.lineno, pos = ts.tokenBeg;
  AstNode pn;
  if (peekToken() == Token.LP) {
    pn = let(true, pos);
  } else {
    pn = variables(Token.LET, pos, true);  // else, e.g.: let x=6, y=7;
  }
  pn.setLineno(lineno);
  return pn;
}

代码示例来源:origin: io.apigee/rhino

private AstNode letStatement()
  throws IOException
{
  if (currentToken != Token.LET) codeBug();
  consumeToken();
  int lineno = ts.lineno, pos = ts.tokenBeg;
  AstNode pn;
  if (peekToken() == Token.LP) {
    pn = let(true, pos);
  } else {
    pn = variables(Token.LET, pos, true);  // else, e.g.: let x=6, y=7;
  }
  pn.setLineno(lineno);
  return pn;
}

代码示例来源:origin: geogebra/geogebra

private AstNode letStatement()
  throws IOException
{
  if (currentToken != Token.LET) codeBug();
  consumeToken();
  int lineno = ts.lineno, pos = ts.tokenBeg;
  AstNode pn;
  if (peekToken() == Token.LP) {
    pn = let(true, pos);
  } else {
    pn = variables(Token.LET, pos, true);  // else, e.g.: let x=6, y=7;
  }
  pn.setLineno(lineno);
  return pn;
}

代码示例来源:origin: com.github.tntim96/rhino

private AstNode letStatement()
  throws IOException
{
  if (currentToken != Token.LET) codeBug();
  consumeToken();
  int lineno = ts.lineno, pos = ts.tokenBeg;
  AstNode pn;
  if (peekToken() == Token.LP) {
    pn = let(true, pos);
  } else {
    pn = variables(Token.LET, pos, true);  // else, e.g.: let x=6, y=7;
  }
  pn.setLineno(lineno);
  return pn;
}

代码示例来源: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: 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: rhino/js

pushScope(result);
try {
   Node vars = variables(false, Token.LET);
   nf.addChildToBack(result, vars);
   mustMatchToken(Token.RP, "msg.no.paren.let");

代码示例来源:origin: geogebra/geogebra

pushScope(pn);
try {
  VariableDeclaration vars = variables(Token.LET, ts.tokenBeg, isStatement);
  pn.setVariables(vars);
  if (mustMatchToken(Token.RP, "msg.no.paren.let")) {

代码示例来源:origin: io.apigee/rhino

pushScope(pn);
try {
  VariableDeclaration vars = variables(Token.LET, ts.tokenBeg, isStatement);
  pn.setVariables(vars);
  if (mustMatchToken(Token.RP, "msg.no.paren.let")) {

代码示例来源:origin: com.github.tntim96/rhino

pushScope(pn);
try {
  VariableDeclaration vars = variables(Token.LET, ts.tokenBeg, isStatement);
  pn.setVariables(vars);
  if (mustMatchToken(Token.RP, "msg.no.paren.let")) {

代码示例来源:origin: ro.isdc.wro4j/rhino

pushScope(pn);
try {
  VariableDeclaration vars = variables(Token.LET, ts.tokenBeg, isStatement);
  pn.setVariables(vars);
  if (mustMatchToken(Token.RP, "msg.no.paren.let")) {

代码示例来源:origin: geogebra/geogebra

consumeToken();
int lineno = ts.lineno;
pn = variables(currentToken, ts.tokenBeg, true);
pn.setLineno(lineno);
break;

代码示例来源:origin: ro.isdc.wro4j/rhino

consumeToken();
int lineno = ts.lineno;
pn = variables(currentToken, ts.tokenBeg, true);
pn.setLineno(lineno);
break;

代码示例来源:origin: io.apigee/rhino

consumeToken();
int lineno = ts.lineno;
pn = variables(currentToken, ts.tokenBeg, true);
pn.setLineno(lineno);
break;

代码示例来源:origin: com.github.tntim96/rhino

consumeToken();
int lineno = ts.lineno;
pn = variables(currentToken, ts.tokenBeg, true);
pn.setLineno(lineno);
break;

代码示例来源:origin: rhino/js

init = variables(true, tt);
      declType = tt;
consumeToken();
decompiler.addToken(tt);
pn = variables(false, tt);
break;
  return let(true);
} else {
  pn = variables(false, tt);
  if (peekToken() == Token.SEMI)
    break;

代码示例来源:origin: com.yahoo/yuicompressor

init = variables(Token.FOR);
case Token.VAR: {
 consumeToken();
 pn = variables(tt);
 break;

代码示例来源:origin: com.sun.phobos/phobos-rhino

init = variables(Token.FOR);
case Token.VAR: {
 consumeToken();
 pn = variables(tt);
 break;

相关文章

Parser类方法