| 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/src/generated/error.dart'; | 9 import 'package:analyzer/src/generated/error.dart'; |
| 10 import 'package:analyzer/src/generated/parser.dart'; | 10 import 'package:analyzer/src/generated/parser.dart'; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 @override | 43 @override |
| 44 bool get checkAstDerivedData => true; | 44 bool get checkAstDerivedData => true; |
| 45 | 45 |
| 46 @override | 46 @override |
| 47 bool get expectAbsoluteUrisInDependencies => false; | 47 bool get expectAbsoluteUrisInDependencies => false; |
| 48 | 48 |
| 49 @override | 49 @override |
| 50 bool get skipFullyLinkedData => true; | 50 bool get skipFullyLinkedData => true; |
| 51 | 51 |
| 52 @override | 52 @override |
| 53 bool get strongMode => false; |
| 54 |
| 55 @override |
| 53 addNamedSource(String filePath, String contents) { | 56 addNamedSource(String filePath, String contents) { |
| 54 CompilationUnit unit = _parseText(contents); | 57 CompilationUnit unit = _parseText(contents); |
| 55 UnlinkedUnit unlinkedUnit = | 58 UnlinkedUnit unlinkedUnit = |
| 56 new UnlinkedUnit.fromBuffer(serializeAstUnlinked(unit).toBuffer()); | 59 new UnlinkedUnit.fromBuffer(serializeAstUnlinked(unit).toBuffer()); |
| 57 uriToUnit[absUri(filePath)] = unlinkedUnit; | 60 uriToUnit[absUri(filePath)] = unlinkedUnit; |
| 58 } | 61 } |
| 59 | 62 |
| 60 @override | 63 @override |
| 61 void serializeLibraryText(String text, {bool allowErrors: false}) { | 64 void serializeLibraryText(String text, {bool allowErrors: false}) { |
| 62 Uri testDartUri = Uri.parse(absUri('/test.dart')); | 65 Uri testDartUri = Uri.parse(absUri('/test.dart')); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 CompilationUnit _parseText(String text) { | 108 CompilationUnit _parseText(String text) { |
| 106 CharSequenceReader reader = new CharSequenceReader(text); | 109 CharSequenceReader reader = new CharSequenceReader(text); |
| 107 Scanner scanner = | 110 Scanner scanner = |
| 108 new Scanner(null, reader, AnalysisErrorListener.NULL_LISTENER); | 111 new Scanner(null, reader, AnalysisErrorListener.NULL_LISTENER); |
| 109 Token token = scanner.tokenize(); | 112 Token token = scanner.tokenize(); |
| 110 Parser parser = new Parser(null, AnalysisErrorListener.NULL_LISTENER); | 113 Parser parser = new Parser(null, AnalysisErrorListener.NULL_LISTENER); |
| 111 parser.parseGenericMethods = true; | 114 parser.parseGenericMethods = true; |
| 112 return parser.parseCompilationUnit(token); | 115 return parser.parseCompilationUnit(token); |
| 113 } | 116 } |
| 114 } | 117 } |
| OLD | NEW |