MCPcopy
hub / github.com/BloombergGraphics/whatiscode / expectKeyword

Function expectKeyword

scripts/libs/esprima.js:2163–2168  ·  view source on GitHub ↗
(keyword)

Source from the content-addressed store, hash-verified

2161 // If not, an exception will be thrown.
2162
2163 function expectKeyword(keyword) {
2164 var token = lex();
2165 if (token.type !== Token.Keyword || token.value !== keyword) {
2166 throwUnexpectedToken(token);
2167 }
2168 }
2169
2170 // Return true if the next token matches the specified punctuator.
2171

Callers 15

parseNewExpressionFunction · 0.85
parseVariableStatementFunction · 0.85
parseIfStatementFunction · 0.85
parseDoWhileStatementFunction · 0.85
parseWhileStatementFunction · 0.85
parseForStatementFunction · 0.85
parseContinueStatementFunction · 0.85
parseBreakStatementFunction · 0.85
parseReturnStatementFunction · 0.85
parseWithStatementFunction · 0.85
parseSwitchCaseFunction · 0.85
parseSwitchStatementFunction · 0.85

Calls 2

lexFunction · 0.85
throwUnexpectedTokenFunction · 0.85

Tested by

no test coverage detected