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

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

Issue 11312237: Dynamic -> dynamic. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
« no previous file with comments | « tests/html/postmessage_structured_test.dart ('k') | no next file » | 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 /** 5 /**
6 * Takes a parsed and composed YAML document (what the spec calls the 6 * Takes a parsed and composed YAML document (what the spec calls the
7 * "representation graph") and creates native Dart objects that represent that 7 * "representation graph") and creates native Dart objects that represent that
8 * document. 8 * document.
9 */ 9 */
10 class _Constructor extends _Visitor { 10 class _Constructor extends _Visitor {
11 /** The root node of the representation graph. */ 11 /** The root node of the representation graph. */
12 _Node root; 12 _Node root;
13 13
14 /** Map from anchor names to the most recent Dart node with that anchor. */ 14 /** Map from anchor names to the most recent Dart node with that anchor. */
15 Map<String, Dynamic> anchors; 15 Map<String, dynamic> anchors;
16 16
17 _Constructor(this.root) : this.anchors = {}; 17 _Constructor(this.root) : this.anchors = {};
18 18
19 /** Runs the Constructor to produce a Dart object. */ 19 /** Runs the Constructor to produce a Dart object. */
20 construct() => root.visit(this); 20 construct() => root.visit(this);
21 21
22 /** Returns the value of a scalar. */ 22 /** Returns the value of a scalar. */
23 visitScalar(_ScalarNode scalar) => scalar.value; 23 visitScalar(_ScalarNode scalar) => scalar.value;
24 24
25 /** Converts a sequence into a List of Dart objects. */ 25 /** Converts a sequence into a List of Dart objects. */
(...skipping 23 matching lines...) Expand all
49 if (anchors.containsKey(anchored.anchor)) return anchors[anchored.anchor]; 49 if (anchors.containsKey(anchored.anchor)) return anchors[anchored.anchor];
50 } 50 }
51 51
52 /** Records that [value] is the Dart object representing [anchored]. */ 52 /** Records that [value] is the Dart object representing [anchored]. */
53 setAnchor(_Node anchored, value) { 53 setAnchor(_Node anchored, value) {
54 if (anchored.anchor == null) return value; 54 if (anchored.anchor == null) return value;
55 anchors[anchored.anchor] = value; 55 anchors[anchored.anchor] = value;
56 return value; 56 return value;
57 } 57 }
58 } 58 }
OLDNEW
« no previous file with comments | « tests/html/postmessage_structured_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698