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

Side by Side Diff: utils/pub/yaml/yaml.dart

Issue 11414069: Make mappedBy lazy. (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: Reupload due to error. Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library yaml; 5 library yaml;
6 6
7 import 'dart:math' as Math; 7 import 'dart:math' as Math;
8 8
9 import 'deep_equals.dart'; 9 import 'deep_equals.dart';
10 10
(...skipping 26 matching lines...) Expand all
37 * Loads a stream of documents from a YAML string. 37 * Loads a stream of documents from a YAML string.
38 * 38 *
39 * The return value is mostly normal Dart objects. However, since YAML mappings 39 * The return value is mostly normal Dart objects. However, since YAML mappings
40 * support some key types that the default Dart map implementation doesn't 40 * support some key types that the default Dart map implementation doesn't
41 * (null, NaN, booleans, lists, and maps), all maps in the returned document are 41 * (null, NaN, booleans, lists, and maps), all maps in the returned document are
42 * YamlMaps. These have a few small behavioral differences from the default Map 42 * YamlMaps. These have a few small behavioral differences from the default Map
43 * implementation; for details, see the YamlMap class. 43 * implementation; for details, see the YamlMap class.
44 */ 44 */
45 List loadYamlStream(String yaml) { 45 List loadYamlStream(String yaml) {
46 return new _Parser(yaml).l_yamlStream().mappedBy((doc) => 46 return new _Parser(yaml).l_yamlStream().mappedBy((doc) =>
47 new _Constructor(new _Composer(doc).compose()).construct()); 47 new _Constructor(new _Composer(doc).compose()).construct())
48 .toList();
48 } 49 }
49 50
50 /** An error thrown by the YAML processor. */ 51 /** An error thrown by the YAML processor. */
51 class YamlException implements Exception { 52 class YamlException implements Exception {
52 String msg; 53 String msg;
53 54
54 YamlException(this.msg); 55 YamlException(this.msg);
55 56
56 String toString() => msg; 57 String toString() => msg;
57 } 58 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698