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

Unified Diff: pkg/analyzer/lib/src/dart/ast/uri_validation_code.dart

Issue 2522143003: Create a new AstFactory class to be used by analyzer and its clients. (Closed)
Patch Set: 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
Index: pkg/analyzer/lib/src/dart/ast/uri_validation_code.dart
diff --git a/pkg/analyzer/lib/src/dart/ast/uri_validation_code.dart b/pkg/analyzer/lib/src/dart/ast/uri_validation_code.dart
new file mode 100644
index 0000000000000000000000000000000000000000..7cd0b2b3801101ab4ab677b09a844551e9c250e3
--- /dev/null
+++ b/pkg/analyzer/lib/src/dart/ast/uri_validation_code.dart
@@ -0,0 +1,32 @@
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analyzer/dart/ast/ast.dart';
+
+/**
+ * Validation codes returned by [UriBasedDirective.validate].
+ */
+class UriValidationCodeImpl implements UriValidationCode {
Brian Wilkerson 2016/11/23 15:58:18 I would prefer to remove the method 'validate' fro
Paul Berry 2016/11/24 15:03:17 Done.
+ static const UriValidationCode INVALID_URI =
+ const UriValidationCodeImpl('INVALID_URI');
+
+ static const UriValidationCode URI_WITH_INTERPOLATION =
+ const UriValidationCodeImpl('URI_WITH_INTERPOLATION');
+
+ static const UriValidationCode URI_WITH_DART_EXT_SCHEME =
+ const UriValidationCodeImpl('URI_WITH_DART_EXT_SCHEME');
+
+ /**
+ * The name of the validation code.
+ */
+ final String name;
+
+ /**
+ * Initialize a newly created validation code to have the given [name].
+ */
+ const UriValidationCodeImpl(this.name);
+
+ @override
+ String toString() => name;
+}

Powered by Google App Engine
This is Rietveld 408576698