(languageVersion, setParentNodes, scriptKind, setExternalModuleIndicator)
| 31674 | topLevel = true; |
| 31675 | } |
| 31676 | function parseSourceFileWorker(languageVersion, setParentNodes, scriptKind, setExternalModuleIndicator) { |
| 31677 | var isDeclarationFile = isDeclarationFileName(fileName); |
| 31678 | if (isDeclarationFile) { |
| 31679 | contextFlags |= 16777216 /* NodeFlags.Ambient */; |
| 31680 | } |
| 31681 | sourceFlags = contextFlags; |
| 31682 | // Prime the scanner. |
| 31683 | nextToken(); |
| 31684 | var statements = parseList(0 /* ParsingContext.SourceElements */, parseStatement); |
| 31685 | ts.Debug.assert(token() === 1 /* SyntaxKind.EndOfFileToken */); |
| 31686 | var endOfFileToken = addJSDocComment(parseTokenNode()); |
| 31687 | var sourceFile = createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile, statements, endOfFileToken, sourceFlags, setExternalModuleIndicator); |
| 31688 | // A member of ReadonlyArray<T> isn't assignable to a member of T[] (and prevents a direct cast) - but this is where we set up those members so they can be readonly in the future |
| 31689 | processCommentPragmas(sourceFile, sourceText); |
| 31690 | processPragmasIntoFields(sourceFile, reportPragmaDiagnostic); |
| 31691 | sourceFile.commentDirectives = scanner.getCommentDirectives(); |
| 31692 | sourceFile.nodeCount = nodeCount; |
| 31693 | sourceFile.identifierCount = identifierCount; |
| 31694 | sourceFile.identifiers = identifiers; |
| 31695 | sourceFile.parseDiagnostics = ts.attachFileToDiagnostics(parseDiagnostics, sourceFile); |
| 31696 | if (jsDocDiagnostics) { |
| 31697 | sourceFile.jsDocDiagnostics = ts.attachFileToDiagnostics(jsDocDiagnostics, sourceFile); |
| 31698 | } |
| 31699 | if (setParentNodes) { |
| 31700 | fixupParentReferences(sourceFile); |
| 31701 | } |
| 31702 | return sourceFile; |
| 31703 | function reportPragmaDiagnostic(pos, end, diagnostic) { |
| 31704 | parseDiagnostics.push(ts.createDetachedDiagnostic(fileName, pos, end, diagnostic)); |
| 31705 | } |
| 31706 | } |
| 31707 | function withJSDoc(node, hasJSDoc) { |
| 31708 | return hasJSDoc ? addJSDocComment(node) : node; |
| 31709 | } |
no test coverage detected
searching dependent graphs…