| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library analyzer.test.src.summary.summarize_ast_test; | 5 library analyzer.test.src.summary.summarize_ast_test; |
| 6 | 6 |
| 7 import 'package:analyzer/analyzer.dart'; | 7 import 'package:analyzer/analyzer.dart'; |
| 8 import 'package:analyzer/dart/ast/ast.dart'; | 8 import 'package:analyzer/dart/ast/ast.dart'; |
| 9 import 'package:analyzer/dart/ast/token.dart'; | 9 import 'package:analyzer/dart/ast/token.dart'; |
| 10 import 'package:analyzer/error/listener.dart'; | 10 import 'package:analyzer/error/listener.dart'; |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 }); | 308 }); |
| 309 return assembler.assemble(); | 309 return assembler.assemble(); |
| 310 } | 310 } |
| 311 | 311 |
| 312 CompilationUnit _parseText(String text) { | 312 CompilationUnit _parseText(String text) { |
| 313 CharSequenceReader reader = new CharSequenceReader(text); | 313 CharSequenceReader reader = new CharSequenceReader(text); |
| 314 Scanner scanner = | 314 Scanner scanner = |
| 315 new Scanner(null, reader, AnalysisErrorListener.NULL_LISTENER); | 315 new Scanner(null, reader, AnalysisErrorListener.NULL_LISTENER); |
| 316 Token token = scanner.tokenize(); | 316 Token token = scanner.tokenize(); |
| 317 Parser parser = new Parser(null, AnalysisErrorListener.NULL_LISTENER); | 317 Parser parser = new Parser(null, AnalysisErrorListener.NULL_LISTENER); |
| 318 parser.parseGenericMethods = true; | |
| 319 CompilationUnit unit = parser.parseCompilationUnit(token); | 318 CompilationUnit unit = parser.parseCompilationUnit(token); |
| 320 unit.lineInfo = new LineInfo(scanner.lineStarts); | 319 unit.lineInfo = new LineInfo(scanner.lineStarts); |
| 321 return unit; | 320 return unit; |
| 322 } | 321 } |
| 323 } | 322 } |
| 324 | 323 |
| 325 /** | 324 /** |
| 326 * [_FilesToLink] stores information about a set of files to be linked together. | 325 * [_FilesToLink] stores information about a set of files to be linked together. |
| 327 * This information is grouped into a class to allow it to be reset easily when | 326 * This information is grouped into a class to allow it to be reset easily when |
| 328 * [SummaryLinkerTest.createLinkerInputs] is called. | 327 * [SummaryLinkerTest.createLinkerInputs] is called. |
| 329 */ | 328 */ |
| 330 class _FilesToLink { | 329 class _FilesToLink { |
| 331 /** | 330 /** |
| 332 * Map from absolute URI to the [UnlinkedUnit] for each compilation unit | 331 * Map from absolute URI to the [UnlinkedUnit] for each compilation unit |
| 333 * passed to [addNamedSource]. | 332 * passed to [addNamedSource]. |
| 334 */ | 333 */ |
| 335 Map<String, UnlinkedUnitBuilder> uriToUnit = <String, UnlinkedUnitBuilder>{}; | 334 Map<String, UnlinkedUnitBuilder> uriToUnit = <String, UnlinkedUnitBuilder>{}; |
| 336 | 335 |
| 337 /** | 336 /** |
| 338 * Information about summaries to be included in the link process. | 337 * Information about summaries to be included in the link process. |
| 339 */ | 338 */ |
| 340 SummaryDataStore summaryDataStore = | 339 SummaryDataStore summaryDataStore = |
| 341 new SummaryDataStore([], recordDependencyInfo: true); | 340 new SummaryDataStore([], recordDependencyInfo: true); |
| 342 } | 341 } |
| OLD | NEW |