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

Function parseUnaryExpression

docs/app/js/sanddance-app.js:144251–144262  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

144249 return expr;
144250} // 11.4 Unary Operators
144251function parseUnaryExpression() {
144252 var token, expr;
144253 if (lookahead.type !== TokenPunctuator && lookahead.type !== TokenKeyword) expr = parsePostfixExpression();
144254 else if (match("++") || match("--")) throw new Error(DISABLED);
144255 else if (match("+") || match("-") || match("~") || match("!")) {
144256 token = lex();
144257 expr = parseUnaryExpression();
144258 expr = finishUnaryExpression(token.value, expr);
144259 } else if (matchKeyword("delete") || matchKeyword("void") || matchKeyword("typeof")) throw new Error(DISABLED);
144260 else expr = parsePostfixExpression();
144261 return expr;
144262}
144263function binaryPrecedence(token) {
144264 let prec = 0;
144265 if (token.type !== TokenPunctuator && token.type !== TokenKeyword) return 0;

Callers 1

parseBinaryExpressionFunction · 0.70

Calls 5

parsePostfixExpressionFunction · 0.70
matchFunction · 0.70
lexFunction · 0.70
finishUnaryExpressionFunction · 0.70
matchKeywordFunction · 0.70

Tested by

no test coverage detected