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

Unified Diff: pkg/yaml/lib/src/style.dart

Issue 689513002: Rewrite the pkg/yaml parser. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 6 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/yaml/lib/src/scanner.dart ('k') | pkg/yaml/lib/src/token.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/yaml/lib/src/style.dart
diff --git a/pkg/yaml/lib/src/style.dart b/pkg/yaml/lib/src/style.dart
new file mode 100644
index 0000000000000000000000000000000000000000..6305fce790cdb6dfe42b591f7d5e4924d8a694da
--- /dev/null
+++ b/pkg/yaml/lib/src/style.dart
@@ -0,0 +1,73 @@
+// Copyright (c) 2014, 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.
+
+library yaml.style;
+
+/// An enum of source scalar styles.
+class ScalarStyle {
+ /// No source style was specified.
+ ///
+ /// This usually indicates a scalar constructed with [YamlScalar.wrap].
+ static const ANY = const ScalarStyle._("ANY");
+
+ /// The plain scalar style, unquoted and without a prefix.
+ ///
+ /// See http://yaml.org/spec/1.2/spec.html#style/flow/plain.
+ static const PLAIN = const ScalarStyle._("PLAIN");
+
+ /// The literal scalar style, with a `|` prefix.
+ ///
+ /// See http://yaml.org/spec/1.2/spec.html#id2795688.
+ static const LITERAL = const ScalarStyle._("LITERAL");
+
+
+ /// The folded scalar style, with a `>` prefix.
+ ///
+ /// See http://yaml.org/spec/1.2/spec.html#id2796251.
+ static const FOLDED = const ScalarStyle._("FOLDED");
+
+ /// The single-quoted scalar style.
+ ///
+ /// See http://yaml.org/spec/1.2/spec.html#style/flow/single-quoted.
+ static const SINGLE_QUOTED = const ScalarStyle._("SINGLE_QUOTED");
+
+ /// The double-quoted scalar style.
+ ///
+ /// See http://yaml.org/spec/1.2/spec.html#style/flow/double-quoted.
+ static const DOUBLE_QUOTED = const ScalarStyle._("DOUBLE_QUOTED");
+
+ final String name;
+
+ /// Whether this is a quoted style ([SINGLE_QUOTED] or [DOUBLE_QUOTED]).
+ bool get isQuoted => this == SINGLE_QUOTED || this == DOUBLE_QUOTED;
+
+ const ScalarStyle._(this.name);
+
+ String toString() => name;
+}
+
+/// An enum of collection styles.
+class CollectionStyle {
+ /// No source style was specified.
+ ///
+ /// This usually indicates a collection constructed with [YamlList.wrap] or
+ /// [YamlMap.wrap].
+ static const ANY = const CollectionStyle._("ANY");
+
+ /// The indentation-based block style.
+ ///
+ /// See http://yaml.org/spec/1.2/spec.html#id2797293.
+ static const BLOCK = const CollectionStyle._("BLOCK");
+
+ /// The delimiter-based block style.
+ ///
+ /// See http://yaml.org/spec/1.2/spec.html#id2790088.
+ static const FLOW = const CollectionStyle._("FLOW");
+
+ final String name;
+
+ const CollectionStyle._(this.name);
+
+ String toString() => name;
+}
« no previous file with comments | « pkg/yaml/lib/src/scanner.dart ('k') | pkg/yaml/lib/src/token.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698