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

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

Issue 11638010: Convert /** comments to /// in pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Respond to review. Created 8 years 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
« no previous file with comments | « utils/pub/yaml/visitor.dart ('k') | utils/pub/yaml/yaml_map.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
11 part 'yaml_map.dart'; 11 part 'yaml_map.dart';
12 part 'model.dart'; 12 part 'model.dart';
13 part 'parser.dart'; 13 part 'parser.dart';
14 part 'visitor.dart'; 14 part 'visitor.dart';
15 part 'composer.dart'; 15 part 'composer.dart';
16 part 'constructor.dart'; 16 part 'constructor.dart';
17 17
18 /** 18 /// Loads a single document from a YAML string. If the string contains more than
19 * Loads a single document from a YAML string. If the string contains more than 19 /// one document, this throws an error.
20 * one document, this throws an error. 20 ///
21 * 21 /// The return value is mostly normal Dart objects. However, since YAML mappings
22 * The return value is mostly normal Dart objects. However, since YAML mappings 22 /// support some key types that the default Dart map implementation doesn't
23 * support some key types that the default Dart map implementation doesn't 23 /// (null, NaN, booleans, lists, and maps), all maps in the returned document
24 * (null, NaN, booleans, lists, and maps), all maps in the returned document are 24 /// are YamlMaps. These have a few small behavioral differences from the default
25 * YamlMaps. These have a few small behavioral differences from the default Map 25 /// Map implementation; for details, see the YamlMap class.
26 * implementation; for details, see the YamlMap class.
27 */
28 loadYaml(String yaml) { 26 loadYaml(String yaml) {
29 var stream = loadYamlStream(yaml); 27 var stream = loadYamlStream(yaml);
30 if (stream.length != 1) { 28 if (stream.length != 1) {
31 throw new YamlException("Expected 1 document, were ${stream.length}"); 29 throw new YamlException("Expected 1 document, were ${stream.length}");
32 } 30 }
33 return stream[0]; 31 return stream[0];
34 } 32 }
35 33
36 /** 34 /// Loads a stream of documents from a YAML string.
37 * Loads a stream of documents from a YAML string. 35 ///
38 * 36 /// 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 37 /// 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 38 /// (null, NaN, booleans, lists, and maps), all maps in the returned document
41 * (null, NaN, booleans, lists, and maps), all maps in the returned document are 39 /// are YamlMaps. These have a few small behavioral differences from the default
42 * YamlMaps. These have a few small behavioral differences from the default Map 40 /// Map implementation; for details, see the YamlMap class.
43 * implementation; for details, see the YamlMap class.
44 */
45 List loadYamlStream(String yaml) { 41 List loadYamlStream(String yaml) {
46 return new _Parser(yaml).l_yamlStream().map((doc) => 42 return new _Parser(yaml).l_yamlStream().map((doc) =>
47 new _Constructor(new _Composer(doc).compose()).construct()); 43 new _Constructor(new _Composer(doc).compose()).construct());
48 } 44 }
49 45
50 /** An error thrown by the YAML processor. */ 46 /// An error thrown by the YAML processor.
51 class YamlException implements Exception { 47 class YamlException implements Exception {
52 String msg; 48 String msg;
53 49
54 YamlException(this.msg); 50 YamlException(this.msg);
55 51
56 String toString() => msg; 52 String toString() => msg;
57 } 53 }
OLDNEW
« no previous file with comments | « utils/pub/yaml/visitor.dart ('k') | utils/pub/yaml/yaml_map.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698