OLD | NEW |
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 constructor; | 5 library yaml.constructor; |
6 | 6 |
7 import 'model.dart'; | 7 import 'model.dart'; |
8 import 'visitor.dart'; | 8 import 'visitor.dart'; |
9 import 'yaml_map.dart'; | 9 import 'yaml_map.dart'; |
10 | 10 |
11 /// Takes a parsed and composed YAML document (what the spec calls the | 11 /// Takes a parsed and composed YAML document (what the spec calls the |
12 /// "representation graph") and creates native Dart objects that represent that | 12 /// "representation graph") and creates native Dart objects that represent that |
13 /// document. | 13 /// document. |
14 class Constructor extends Visitor { | 14 class Constructor extends Visitor { |
15 /// The root node of the representation graph. | 15 /// The root node of the representation graph. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 if (_anchors.containsKey(anchored.anchor)) return _anchors[anchored.anchor]; | 51 if (_anchors.containsKey(anchored.anchor)) return _anchors[anchored.anchor]; |
52 } | 52 } |
53 | 53 |
54 /// Records that [value] is the Dart object representing [anchored]. | 54 /// Records that [value] is the Dart object representing [anchored]. |
55 setAnchor(Node anchored, value) { | 55 setAnchor(Node anchored, value) { |
56 if (anchored.anchor == null) return value; | 56 if (anchored.anchor == null) return value; |
57 _anchors[anchored.anchor] = value; | 57 _anchors[anchored.anchor] = value; |
58 return value; | 58 return value; |
59 } | 59 } |
60 } | 60 } |
OLD | NEW |