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

Unified Diff: pkg/analyzer/lib/src/generated/sdk.dart

Issue 1395863002: Introduce the "Embedded" category. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fix analyzer test Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/all_the_rest_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/sdk.dart
diff --git a/pkg/analyzer/lib/src/generated/sdk.dart b/pkg/analyzer/lib/src/generated/sdk.dart
index 1bf502bb5695847cf0da1268d13642044f90c789..c4f034fcdd819730c4cc9f1bac376da0af14ffb7 100644
--- a/pkg/analyzer/lib/src/generated/sdk.dart
+++ b/pkg/analyzer/lib/src/generated/sdk.dart
@@ -145,7 +145,7 @@ class SdkLibrariesReader_LibraryBuilder extends RecursiveAstVisitor<Object> {
* The name of the optional parameter used to specify the category of the
* library.
*/
- static String _CATEGORY = "category";
+ static String _CATEGORIES = "categories";
/**
* The name of the optional parameter used to specify the platforms on which
@@ -183,6 +183,20 @@ class SdkLibrariesReader_LibraryBuilder extends RecursiveAstVisitor<Object> {
*/
LibraryMap get librariesMap => _librariesMap;
+
+ // To be backwards-compatible the new categories field is translated to
+ // an old approximation.
+ String convertCategories(String categories) {
+ switch (categories) {
+ case "": return "Internal";
+ case "Client": return "Client";
+ case "Server": return "Server";
+ case "Client,Server": return "Shared";
+ case "Client,Server,Embedded": return "Shared";
+ }
+ return "Shared";
+ }
+
@override
Object visitMapLiteralEntry(MapLiteralEntry node) {
String libraryName = null;
@@ -200,8 +214,9 @@ class SdkLibrariesReader_LibraryBuilder extends RecursiveAstVisitor<Object> {
} else if (argument is NamedExpression) {
String name = argument.name.label.name;
Expression expression = argument.expression;
- if (name == _CATEGORY) {
- library.category = (expression as SimpleStringLiteral).value;
+ if (name == _CATEGORIES) {
+ library.category =
+ convertCategories((expression as StringLiteral).stringValue);
} else if (name == _IMPLEMENTATION) {
library.implementation = (expression as BooleanLiteral).value;
} else if (name == _DOCUMENTED) {
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/all_the_rest_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698