// Then parse the token stream.
//
TimeCounterHandle timeCounterParse = PerformanceStatistics.parse.start();
try {
final RecordingErrorListener errorListener = new RecordingErrorListener();
Parser parser = new Parser(source, errorListener);
AnalysisOptions options = getContext().getAnalysisOptions();
parser.setParseFunctionBodies(options.getAnalyzeFunctionBodies());
parser.setParseAsync(options.getEnableAsync());
parser.setParseDeferredLibraries(options.getEnableDeferredLoading());
parser.setParseEnum(options.getEnableEnum());
unit = parser.parseCompilationUnit(tokenStream);
unit.setLineInfo(lineInfo);
AnalysisContext analysisContext = getContext();
for (Directive directive : unit.getDirectives()) {
if (directive instanceof PartOfDirective) {
containsPartOfDirective = true;