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

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

Issue 302313007: Attach source range information to parsed YAML nodes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix tests 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/visitor.dart ('k') | pkg/yaml/lib/src/yaml_node.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 library yaml.map;
6
7 import 'dart:collection';
8
9 import 'package:collection/collection.dart';
10
11 import 'deep_equals.dart';
12 import 'utils.dart';
13
14 /// This class behaves almost identically to the normal Dart [Map]
15 /// implementation, with the following differences:
16 ///
17 /// * It allows NaN, list, and map keys.
18 /// * It defines `==` structurally. That is, `yamlMap1 == yamlMap2` if they
19 /// have the same contents.
20 /// * It has a compatible [hashCode] method.
21 ///
22 /// This class is deprecated. In future releases, this package will use
23 /// a [HashMap] with a custom equality operation rather than a custom class.
24 @Deprecated('1.0.0')
25 class YamlMap extends DelegatingMap {
26 YamlMap()
27 : super(new HashMap(equals: deepEquals, hashCode: hashCodeFor));
28
29 YamlMap.from(Map map)
30 : super(new HashMap(equals: deepEquals, hashCode: hashCodeFor)) {
31 addAll(map);
32 }
33
34 int get hashCode => hashCodeFor(this);
35
36 bool operator ==(other) {
37 if (other is! YamlMap) return false;
38 return deepEquals(this, other);
39 }
40 }
OLDNEW
« no previous file with comments | « pkg/yaml/lib/src/visitor.dart ('k') | pkg/yaml/lib/src/yaml_node.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698