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

Unified Diff: pkg/analyzer/lib/src/summary/summarize_ast.dart

Issue 2459573005: Add UnlinkedUnit.isPartOf flag. (Closed)
Patch Set: tweak the comment Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/summary/idl.dart ('k') | pkg/analyzer/test/src/summary/summary_common.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/summarize_ast.dart
diff --git a/pkg/analyzer/lib/src/summary/summarize_ast.dart b/pkg/analyzer/lib/src/summary/summarize_ast.dart
index 82d596e55a91cfbb507f9ba248fb9051cbaccfb9..94b8264b4c385bf77f37ac393ca105fec5151cc7 100644
--- a/pkg/analyzer/lib/src/summary/summarize_ast.dart
+++ b/pkg/analyzer/lib/src/summary/summarize_ast.dart
@@ -298,6 +298,11 @@ class _SummarizeAstVisitor extends RecursiveAstVisitor {
bool isCoreLibrary = false;
/**
+ * True is a [PartOfDirective] was found, so the unit is a part.
+ */
+ bool isPartOf = false;
+
+ /**
* If the library has a library directive, the library name derived from it.
* Otherwise `null`.
*/
@@ -518,6 +523,7 @@ class _SummarizeAstVisitor extends RecursiveAstVisitor {
compilationUnit.declarations.accept(this);
UnlinkedUnitBuilder b = new UnlinkedUnitBuilder();
b.lineStarts = compilationUnit.lineInfo?.lineStarts;
+ b.isPartOf = isPartOf;
b.libraryName = libraryName;
b.libraryNameOffset = libraryNameOffset;
b.libraryNameLength = libraryNameLength;
@@ -1345,6 +1351,7 @@ class _SummarizeAstVisitor extends RecursiveAstVisitor {
@override
void visitPartOfDirective(PartOfDirective node) {
isCoreLibrary = node.libraryName.name == 'dart.core';
+ isPartOf = true;
}
@override
« no previous file with comments | « pkg/analyzer/lib/src/summary/idl.dart ('k') | pkg/analyzer/test/src/summary/summary_common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698