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

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

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

Parser.getAndResetJsDoc介绍

暂无

代码示例

代码示例来源: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: 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;
  }
}

代码示例来源: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: 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: 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: 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: ro.isdc.wro4j/rhino

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;
}

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

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;
}

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

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;
}

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

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;
}

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

pn.setType(declType);
pn.setLineno(ts.lineno);
Comment varjsdocNode = getAndResetJsDoc();
if (varjsdocNode != null) {
  pn.setJsDocNode(varjsdocNode);
  Comment jsdocNode = getAndResetJsDoc();

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

pn.setType(declType);
pn.setLineno(ts.lineno);
Comment varjsdocNode = getAndResetJsDoc();
if (varjsdocNode != null) {
  pn.setJsDocNode(varjsdocNode);
  Comment jsdocNode = getAndResetJsDoc();

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

pn.setType(declType);
pn.setLineno(ts.lineno);
Comment varjsdocNode = getAndResetJsDoc();
if (varjsdocNode != null) {
  pn.setJsDocNode(varjsdocNode);
  Comment jsdocNode = getAndResetJsDoc();

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

getAndResetJsDoc();
if (!isExpressionClosure && mustMatchToken(Token.RC, "msg.no.brace.after.body"))
  end = ts.tokenEnd;

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

getAndResetJsDoc();
if (!isExpressionClosure && mustMatchToken(Token.RC, "msg.no.brace.after.body"))
  end = ts.tokenEnd;

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

getAndResetJsDoc();
if (!isExpressionClosure && mustMatchToken(Token.RC, "msg.no.brace.after.body"))
  end = ts.tokenEnd;

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

getAndResetJsDoc();
if (!isExpressionClosure && mustMatchToken(Token.RC, "msg.no.brace.after.body"))
  end = ts.tokenEnd;

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

Comment jsdocNode = getAndResetJsDoc();

相关文章

Parser类方法