MCPcopy Create free account
hub / github.com/mozilla/rhino / matchToken

Method matchToken

rhino/src/main/java/org/mozilla/javascript/Parser.java:491–502  ·  view source on GitHub ↗
(int toMatch, boolean ignoreComment)

Source from the content-addressed store, hash-verified

489 }
490
491 private boolean matchToken(int toMatch, boolean ignoreComment) throws IOException {
492 int tt = peekToken();
493 while (tt == Token.COMMENT && ignoreComment) {
494 consumeToken();
495 tt = peekToken();
496 }
497 if (tt != toMatch) {
498 return false;
499 }
500 consumeToken();
501 return true;
502 }
503
504 // Returns Token.EOL if the current token follows a newline, else returns
505 // the current token. Used in situations where we don't consider certain

Callers 15

mustMatchTokenMethod · 0.95
parseFunctionBodyMethod · 0.95
parseFunctionParamsMethod · 0.95
functionMethod · 0.95
ifStatementMethod · 0.95
doLoopMethod · 0.95
forLoopMethod · 0.95
tryStatementMethod · 0.95
defaultXmlNamespaceMethod · 0.95
variablesMethod · 0.95
exprMethod · 0.95
condExprMethod · 0.95

Calls 2

peekTokenMethod · 0.95
consumeTokenMethod · 0.95

Tested by

no test coverage detected