Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Side by Side Diff: pkg/analyzer/lib/src/dart/analysis/file_state.dart

Issue 2662363002: The file is a library, if it has a 'library' directive. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/src/dart/analysis/file_state_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 184
185 @override 185 @override
186 int get hashCode => uri.hashCode; 186 int get hashCode => uri.hashCode;
187 187
188 /** 188 /**
189 * The list of files this file imports. 189 * The list of files this file imports.
190 */ 190 */
191 List<FileState> get importedFiles => _importedFiles; 191 List<FileState> get importedFiles => _importedFiles;
192 192
193 /** 193 /**
194 * Return `true` if the file has a `part of` directive, so is probably a part. 194 * Return `true` if the file does not have a `library` directive, and has a
195 * `part of` directive, so is probably a part.
195 */ 196 */
196 bool get isPart => _unlinked.isPartOf; 197 bool get isPart => _unlinked.libraryNameOffset == 0 && _unlinked.isPartOf;
Brian Wilkerson 2017/01/31 20:33:00 I'm concerned about this because it appears that u
197 198
198 /** 199 /**
199 * If the file [isPart], return a currently know library the file is a part 200 * If the file [isPart], return a currently know library the file is a part
200 * of. Return `null` if a library is not known, for example because we have 201 * of. Return `null` if a library is not known, for example because we have
201 * not processed a library file yet. 202 * not processed a library file yet.
202 */ 203 */
203 FileState get library { 204 FileState get library {
204 List<FileState> libraries = _fsState._partToLibraries[this]; 205 List<FileState> libraries = _fsState._partToLibraries[this];
205 if (libraries == null || libraries.isEmpty) { 206 if (libraries == null || libraries.isEmpty) {
206 return null; 207 return null;
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 .where((f) => f._transitiveFiles == null) 705 .where((f) => f._transitiveFiles == null)
705 .toSet(); 706 .toSet();
706 } 707 }
707 708
708 Set<FileState> get filesWithoutTransitiveSignature { 709 Set<FileState> get filesWithoutTransitiveSignature {
709 return state._uriToFile.values 710 return state._uriToFile.values
710 .where((f) => f._transitiveSignature == null) 711 .where((f) => f._transitiveSignature == null)
711 .toSet(); 712 .toSet();
712 } 713 }
713 } 714 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/dart/analysis/file_state_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698