| 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 import 'dart:convert'; | 5 import 'dart:convert'; |
| 6 import 'dart:typed_data'; | 6 import 'dart:typed_data'; |
| 7 | 7 |
| 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 16 matching lines...) Expand all Loading... |
| 27 import 'package:analyzer/src/summary/package_bundle_reader.dart'; | 27 import 'package:analyzer/src/summary/package_bundle_reader.dart'; |
| 28 import 'package:analyzer/src/summary/summarize_ast.dart'; | 28 import 'package:analyzer/src/summary/summarize_ast.dart'; |
| 29 import 'package:convert/convert.dart'; | 29 import 'package:convert/convert.dart'; |
| 30 import 'package:crypto/crypto.dart'; | 30 import 'package:crypto/crypto.dart'; |
| 31 import 'package:front_end/src/base/api_signature.dart'; | 31 import 'package:front_end/src/base/api_signature.dart'; |
| 32 import 'package:front_end/src/base/performace_logger.dart'; | 32 import 'package:front_end/src/base/performace_logger.dart'; |
| 33 import 'package:front_end/src/byte_store/byte_store.dart'; | 33 import 'package:front_end/src/byte_store/byte_store.dart'; |
| 34 import 'package:front_end/src/fasta/builder/builder.dart' as fasta; | 34 import 'package:front_end/src/fasta/builder/builder.dart' as fasta; |
| 35 import 'package:front_end/src/fasta/parser/parser.dart' as fasta; | 35 import 'package:front_end/src/fasta/parser/parser.dart' as fasta; |
| 36 import 'package:front_end/src/fasta/scanner.dart' as fasta; | 36 import 'package:front_end/src/fasta/scanner.dart' as fasta; |
| 37 import 'package:front_end/src/fasta/scanner/token.dart'; |
| 37 import 'package:meta/meta.dart'; | 38 import 'package:meta/meta.dart'; |
| 38 | 39 |
| 39 /** | 40 /** |
| 40 * [FileContentOverlay] is used to temporary override content of files. | 41 * [FileContentOverlay] is used to temporary override content of files. |
| 41 */ | 42 */ |
| 42 class FileContentOverlay { | 43 class FileContentOverlay { |
| 43 final _map = <String, String>{}; | 44 final _map = <String, String>{}; |
| 44 | 45 |
| 45 /** | 46 /** |
| 46 * Return the paths currently being overridden. | 47 * Return the paths currently being overridden. |
| (...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 Token token = PerformanceStatistics.scan.makeCurrentWhile(() { | 612 Token token = PerformanceStatistics.scan.makeCurrentWhile(() { |
| 612 return scanner.tokenize(); | 613 return scanner.tokenize(); |
| 613 }); | 614 }); |
| 614 LineInfo lineInfo = new LineInfo(scanner.lineStarts); | 615 LineInfo lineInfo = new LineInfo(scanner.lineStarts); |
| 615 | 616 |
| 616 Parser parser = new Parser(source, errorListener); | 617 Parser parser = new Parser(source, errorListener); |
| 617 parser.enableAssertInitializer = analysisOptions.enableAssertInitializer; | 618 parser.enableAssertInitializer = analysisOptions.enableAssertInitializer; |
| 618 parser.parseGenericMethodComments = analysisOptions.strongMode; | 619 parser.parseGenericMethodComments = analysisOptions.strongMode; |
| 619 CompilationUnit unit = parser.parseCompilationUnit(token); | 620 CompilationUnit unit = parser.parseCompilationUnit(token); |
| 620 unit.lineInfo = lineInfo; | 621 unit.lineInfo = lineInfo; |
| 622 |
| 623 // StringToken uses a static instance of StringCanonicalizer, so we need |
| 624 // to clear it explicitly once we are done using it for this file. |
| 625 StringToken.canonicalizer.clear(); |
| 626 |
| 621 return unit; | 627 return unit; |
| 622 } | 628 } |
| 623 } | 629 } |
| 624 | 630 |
| 625 /** | 631 /** |
| 626 * Return `true` if the given byte lists are equal. | 632 * Return `true` if the given byte lists are equal. |
| 627 */ | 633 */ |
| 628 static bool _equalByteLists(List<int> a, List<int> b) { | 634 static bool _equalByteLists(List<int> a, List<int> b) { |
| 629 if (a == null) { | 635 if (a == null) { |
| 630 return b == null; | 636 return b == null; |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 882 .where((f) => f._transitiveFiles == null) | 888 .where((f) => f._transitiveFiles == null) |
| 883 .toSet(); | 889 .toSet(); |
| 884 } | 890 } |
| 885 | 891 |
| 886 Set<FileState> get filesWithoutTransitiveSignature { | 892 Set<FileState> get filesWithoutTransitiveSignature { |
| 887 return state._uriToFile.values | 893 return state._uriToFile.values |
| 888 .where((f) => f._transitiveSignature == null) | 894 .where((f) => f._transitiveSignature == null) |
| 889 .toSet(); | 895 .toSet(); |
| 890 } | 896 } |
| 891 } | 897 } |
| OLD | NEW |