MCPcopy Index your code
hub / github.com/nodejs/node / parseModuleDeclaration

Function parseModuleDeclaration

test/fixtures/snapshot/typescript.js:37020–37036  ·  view source on GitHub ↗
(pos, hasJSDoc, decorators, modifiers)

Source from the content-addressed store, hash-verified

37018 return withJSDoc(finishNode(node, pos), hasJSDoc);
37019 }
37020 function parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers) {
37021 var flags = 0;
37022 if (token() === 157 /* SyntaxKind.GlobalKeyword */) {
37023 // global augmentation
37024 return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers);
37025 }
37026 else if (parseOptional(142 /* SyntaxKind.NamespaceKeyword */)) {
37027 flags |= 16 /* NodeFlags.Namespace */;
37028 }
37029 else {
37030 parseExpected(141 /* SyntaxKind.ModuleKeyword */);
37031 if (token() === 10 /* SyntaxKind.StringLiteral */) {
37032 return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers);
37033 }
37034 }
37035 return parseModuleOrNamespaceDeclaration(pos, hasJSDoc, decorators, modifiers, flags);
37036 }
37037 function isExternalModuleReference() {
37038 return token() === 146 /* SyntaxKind.RequireKeyword */ &&
37039 lookAhead(nextTokenIsOpenParen);

Callers 1

parseDeclarationWorkerFunction · 0.85

Calls 5

parseOptionalFunction · 0.85
parseExpectedFunction · 0.85
tokenFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…