MCPcopy Create free account
hub / github.com/BloombergGraphics/whatiscode / consumeSemicolon

Function consumeSemicolon

scripts/libs/esprima.js:2205–2224  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2203 }
2204
2205 function consumeSemicolon() {
2206 // Catch the very common case first: immediately a semicolon (U+003B).
2207 if (source.charCodeAt(startIndex) === 0x3B || match(';')) {
2208 lex();
2209 return;
2210 }
2211
2212 if (hasLineTerminator) {
2213 return;
2214 }
2215
2216 // FIXME(ikarienator): this is seemingly an issue in the previous location info convention.
2217 lastIndex = startIndex;
2218 lastLineNumber = startLineNumber;
2219 lastLineStart = startLineStart;
2220
2221 if (lookahead.type !== Token.EOF && !match('}')) {
2222 throwUnexpectedToken(lookahead);
2223 }
2224 }
2225
2226 // Return true if provided expression is LeftHandSideExpression
2227

Callers 10

parseVariableStatementFunction · 0.85
parseLexicalDeclarationFunction · 0.85
parseExpressionStatementFunction · 0.85
parseForStatementFunction · 0.85
parseContinueStatementFunction · 0.85
parseBreakStatementFunction · 0.85
parseReturnStatementFunction · 0.85
parseThrowStatementFunction · 0.85
parseDebuggerStatementFunction · 0.85
parseStatementFunction · 0.85

Calls 3

matchFunction · 0.85
lexFunction · 0.85
throwUnexpectedTokenFunction · 0.85

Tested by

no test coverage detected