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

Side by Side Diff: pkg/yaml/lib/visitor.dart

Issue 12090093: Reapply "Rename mappedBy to map." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed bug in previous commit. Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/yaml/lib/model.dart ('k') | pkg/yaml/lib/yaml.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 part of yaml; 5 part of yaml;
6 6
7 /// The visitor pattern for YAML documents. 7 /// The visitor pattern for YAML documents.
8 class _Visitor { 8 class _Visitor {
9 /// Returns [alias]. 9 /// Returns [alias].
10 visitAlias(_AliasNode alias) => alias; 10 visitAlias(_AliasNode alias) => alias;
11 11
12 /// Returns [scalar]. 12 /// Returns [scalar].
13 visitScalar(_ScalarNode scalar) => scalar; 13 visitScalar(_ScalarNode scalar) => scalar;
14 14
15 /// Visits each node in [seq] and returns a list of the results. 15 /// Visits each node in [seq] and returns a list of the results.
16 visitSequence(_SequenceNode seq) 16 visitSequence(_SequenceNode seq)
17 => seq.content.mappedBy((e) => e.visit(this)).toList(); 17 => seq.content.map((e) => e.visit(this)).toList();
18 18
19 /// Visits each key and value in [map] and returns a map of the results. 19 /// Visits each key and value in [map] and returns a map of the results.
20 visitMapping(_MappingNode map) { 20 visitMapping(_MappingNode map) {
21 var out = new YamlMap(); 21 var out = new YamlMap();
22 for (var key in map.content.keys) { 22 for (var key in map.content.keys) {
23 out[key.visit(this)] = map.content[key].visit(this); 23 out[key.visit(this)] = map.content[key].visit(this);
24 } 24 }
25 return out; 25 return out;
26 } 26 }
27 } 27 }
OLDNEW
« no previous file with comments | « pkg/yaml/lib/model.dart ('k') | pkg/yaml/lib/yaml.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698