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

Unified Diff: yaml/lib/yaml.dart

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: 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 | « yaml/lib/src/yaml_node_wrapper.dart ('k') | yaml/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: yaml/lib/yaml.dart
diff --git a/yaml/lib/yaml.dart b/yaml/lib/yaml.dart
deleted file mode 100644
index aa120ef9790fc52daa793888010bb1455896f813..0000000000000000000000000000000000000000
--- a/yaml/lib/yaml.dart
+++ /dev/null
@@ -1,112 +0,0 @@
-// Copyright (c) 2012, 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;
-
-import 'src/loader.dart';
-import 'src/style.dart';
-import 'src/yaml_document.dart';
-import 'src/yaml_exception.dart';
-import 'src/yaml_node.dart';
-
-export 'src/style.dart';
-export 'src/utils.dart' show YamlWarningCallback, yamlWarningCallback;
-export 'src/yaml_document.dart';
-export 'src/yaml_exception.dart';
-export 'src/yaml_node.dart' hide setSpan;
-
-/// Loads a single document from a YAML string.
-///
-/// If the string contains more than one document, this throws a
-/// [YamlException]. In future releases, this will become an [ArgumentError].
-///
-/// The return value is mostly normal Dart objects. However, since YAML mappings
-/// support some key types that the default Dart map implementation doesn't
-/// (NaN, lists, and maps), all maps in the returned document are [YamlMap]s.
-/// These have a few small behavioral differences from the default Map
-/// implementation; for details, see the [YamlMap] class.
-///
-/// In future versions, maps will instead be [HashMap]s with a custom equality
-/// operation.
-///
-/// If [sourceUrl] is passed, it's used as the URL from which the YAML
-/// originated for error reporting. It can be a [String], a [Uri], or `null`.
-loadYaml(String yaml, {sourceUrl}) =>
- loadYamlNode(yaml, sourceUrl: sourceUrl).value;
-
-/// Loads a single document from a YAML string as a [YamlNode].
-///
-/// This is just like [loadYaml], except that where [loadYaml] would return a
-/// normal Dart value this returns a [YamlNode] instead. This allows the caller
-/// to be confident that the return value will always be a [YamlNode].
-YamlNode loadYamlNode(String yaml, {sourceUrl}) =>
- loadYamlDocument(yaml, sourceUrl: sourceUrl).contents;
-
-/// Loads a single document from a YAML string as a [YamlDocument].
-///
-/// This is just like [loadYaml], except that where [loadYaml] would return a
-/// normal Dart value this returns a [YamlDocument] instead. This allows the
-/// caller to access document metadata.
-YamlDocument loadYamlDocument(String yaml, {sourceUrl}) {
- var loader = new Loader(yaml, sourceUrl: sourceUrl);
- var document = loader.load();
- if (document == null) {
- return new YamlDocument.internal(
- new YamlScalar.internalWithSpan(null, loader.span),
- loader.span, null, const []);
- }
-
- var nextDocument = loader.load();
- if (nextDocument != null) {
- throw new YamlException("Only expected one document.", nextDocument.span);
- }
-
- return document;
-}
-
-/// Loads a stream of documents from a YAML string.
-///
-/// The return value is mostly normal Dart objects. However, since YAML mappings
-/// support some key types that the default Dart map implementation doesn't
-/// (NaN, lists, and maps), all maps in the returned document are [YamlMap]s.
-/// These have a few small behavioral differences from the default Map
-/// implementation; for details, see the [YamlMap] class.
-///
-/// In future versions, maps will instead be [HashMap]s with a custom equality
-/// operation.
-///
-/// If [sourceUrl] is passed, it's used as the URL from which the YAML
-/// originated for error reporting. It can be a [String], a [Uri], or `null`.
-YamlList loadYamlStream(String yaml, {sourceUrl}) {
- var loader = new Loader(yaml, sourceUrl: sourceUrl);
-
- var documents = [];
- var document = loader.load();
- while (document != null) {
- documents.add(document);
- document = loader.load();
- }
-
- return new YamlList.internal(
- documents.map((document) => document.contents).toList(),
- loader.span,
- CollectionStyle.ANY);
-}
-
-/// Loads a stream of documents from a YAML string.
-///
-/// This is like [loadYamlStream], except that it returns [YamlDocument]s with
-/// metadata wrapping the document contents.
-List<YamlDocument> loadYamlDocuments(String yaml, {sourceUrl}) {
- var loader = new Loader(yaml, sourceUrl: sourceUrl);
-
- var documents = [];
- var document = loader.load();
- while (document != null) {
- documents.add(document);
- document = loader.load();
- }
-
- return documents;
-}
« no previous file with comments | « yaml/lib/src/yaml_node_wrapper.dart ('k') | yaml/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698