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

Side by Side Diff: frog/await/nodeset.dart

Issue 10548047: Remove frog from the repository. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Move test and update apidoc.gyp. Created 8 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 | « frog/await/checker.dart ('k') | frog/await/normalizer.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) 2011, 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 /** Weak set of AST nodes. */
6 // TODO(sigmund): delete this. This is a temporary workaround to keep 'frog'
7 // as independent as possible of the await experimental feature. Ideally we
8 // should either make [Node] hashable or store information collected by analyses
9 // in the nodes themselves.
10 class NodeSet {
11 Map<String, List<Node>> _hashset;
12 NodeSet() : _hashset = {};
13
14 bool add(Node n) {
15 if (contains(n)) return false;
16 String key = n.span.locationText;
17 List<Node> nodes = _hashset[key];
18 if (nodes == null) {
19 _hashset[key] = [n];
20 } else {
21 nodes.add(n);
22 }
23 return true;
24 }
25
26 bool contains(Node n) {
27 String key = n.span.locationText;
28 List<Node> nodes = _hashset[key];
29 if (nodes == null) {
30 return false;
31 }
32 for (Node member in nodes) {
33 if (n === member) return true;
34 }
35 return false;
36 }
37 }
OLDNEW
« no previous file with comments | « frog/await/checker.dart ('k') | frog/await/normalizer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698