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

Unified Diff: pkg/analyzer/lib/src/util/yaml.dart

Issue 2183003003: Associate excludes with context data. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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
Index: pkg/analyzer/lib/src/util/yaml.dart
diff --git a/pkg/analyzer/lib/src/util/yaml.dart b/pkg/analyzer/lib/src/util/yaml.dart
index 4f71bd74869f7ec6c6bdddc66cea11dd46d32112..f53086e44c881fc4d3c5aa7178c9c33abc1e54cd 100644
--- a/pkg/analyzer/lib/src/util/yaml.dart
+++ b/pkg/analyzer/lib/src/util/yaml.dart
@@ -6,6 +6,25 @@ library analyzer.src.util.yaml;
import 'dart:collection';
+import 'package:yaml/yaml.dart';
+
+/// If all of the elements of [list] are strings, return a list of strings
+/// containing the same elements. Otherwise, return `null`.
+List<String> toStringList(YamlList list) {
+ if (list == null) {
+ return null;
+ }
+ List<String> stringList = <String>[];
+ for (var element in list) {
+ if (element is String) {
+ stringList.add(element);
+ } else {
+ return null;
+ }
+ }
+ return stringList;
+}
+
/// Merges two maps (of yaml) with simple override semantics, suitable for
/// merging two maps where one map defines default values that are added to
/// (and possibly overriden) by an overriding map.

Powered by Google App Engine
This is Rietveld 408576698