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

Side by Side Diff: pkg/yaml/lib/src/constructor.dart

Issue 318513002: Fix a variable name typo in yaml. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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/src/composer.dart ('k') | pkg/yaml/lib/src/parser.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.constructor; 5 library yaml.constructor;
6 6
7 import 'equality.dart'; 7 import 'equality.dart';
8 import 'model.dart'; 8 import 'model.dart';
9 import 'visitor.dart'; 9 import 'visitor.dart';
10 import 'yaml_node.dart'; 10 import 'yaml_node.dart';
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 var dartMap = setAnchor(map, new YamlMap(nodes, map.span)); 46 var dartMap = setAnchor(map, new YamlMap(nodes, map.span));
47 super.visitMapping(map).forEach((k, v) => nodes[k] = v); 47 super.visitMapping(map).forEach((k, v) => nodes[k] = v);
48 return dartMap; 48 return dartMap;
49 } 49 }
50 50
51 /// Returns a new Dart object wrapping the object that already represents 51 /// Returns a new Dart object wrapping the object that already represents
52 /// [anchored], if such a thing exists. 52 /// [anchored], if such a thing exists.
53 YamlNode getAnchor(Node anchored) { 53 YamlNode getAnchor(Node anchored) {
54 if (anchored.anchor == null) return null; 54 if (anchored.anchor == null) return null;
55 var value = _anchors[anchored.anchor]; 55 var value = _anchors[anchored.anchor];
56 if (vaule == null) return null; 56 if (value == null) return null;
57 57
58 // Re-wrap [value]'s contents so that it's associated with the span of the 58 // Re-wrap [value]'s contents so that it's associated with the span of the
59 // anchor rather than its original definition. 59 // anchor rather than its original definition.
60 if (value is YamlMap) return new YamlMap(value.nodes, anchored.span); 60 if (value is YamlMap) return new YamlMap(value.nodes, anchored.span);
61 if (value is YamlList) return new YamlList(value.nodes, anchored.span); 61 if (value is YamlList) return new YamlList(value.nodes, anchored.span);
62 assert(value is YamlScalar); 62 assert(value is YamlScalar);
63 return new YamlScalar(value.value, anchored.span); 63 return new YamlScalar(value.value, anchored.span);
64 } 64 }
65 65
66 /// Records that [value] is the Dart object representing [anchored]. 66 /// Records that [value] is the Dart object representing [anchored].
67 YamlNode setAnchor(Node anchored, YamlNode value) { 67 YamlNode setAnchor(Node anchored, YamlNode value) {
68 if (anchored.anchor == null) return value; 68 if (anchored.anchor == null) return value;
69 _anchors[anchored.anchor] = value; 69 _anchors[anchored.anchor] = value;
70 return value; 70 return value;
71 } 71 }
72 } 72 }
OLDNEW
« no previous file with comments | « pkg/yaml/lib/src/composer.dart ('k') | pkg/yaml/lib/src/parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698