MCPcopy Create free account
hub / github.com/microsoft/SandDance / expect

Function expect

docs/app/js/sanddance-app.js:144096–144099  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

144094} // Expect the next token to match the specified punctuator.
144095// If not, an exception will be thrown.
144096function expect(value) {
144097 const token = lex();
144098 if (token.type !== TokenPunctuator || token.value !== value) throwUnexpected(token);
144099} // Return true if the next token matches the specified punctuator.
144100function match(value) {
144101 return lookahead.type === TokenPunctuator && lookahead.value === value;
144102} // Return true if the next token matches the specified keyword

Callers 8

parseArrayInitialiserFunction · 0.70
parseObjectPropertyFunction · 0.70
parseObjectInitialiserFunction · 0.70
parseGroupExpressionFunction · 0.70
parseArgumentsFunction · 0.70
parseNonComputedMemberFunction · 0.70
parseComputedMemberFunction · 0.70

Calls 2

lexFunction · 0.70
throwUnexpectedFunction · 0.70

Tested by

no test coverage detected