MCPcopy
hub / github.com/jquery/esprima / expectKeyword

Method expectKeyword

src/parser.ts:468–473  ·  view source on GitHub ↗
(keyword)

Source from the content-addressed store, hash-verified

466 // If not, an exception will be thrown.
467
468 expectKeyword(keyword) {
469 const token = this.nextToken();
470 if (token.type !== Token.Keyword || token.value !== keyword) {
471 this.throwUnexpectedToken(token);
472 }
473 }
474
475 // Return true if the next token matches the specified punctuator.
476

Callers 15

parseSuperMethod · 0.95
parseIfStatementMethod · 0.95
parseDoWhileStatementMethod · 0.95
parseWhileStatementMethod · 0.95
parseForStatementMethod · 0.95
parseBreakStatementMethod · 0.95
parseReturnStatementMethod · 0.95
parseWithStatementMethod · 0.95
parseSwitchCaseMethod · 0.95
parseSwitchStatementMethod · 0.95

Calls 2

nextTokenMethod · 0.95
throwUnexpectedTokenMethod · 0.95

Tested by

no test coverage detected