| 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 dart2js.tokens.token_map; | 5 library dart2js.tokens.token_map; |
| 6 | 6 |
| 7 import 'scannerlib.dart' show | 7 import 'token.dart' show |
| 8 Token; | 8 Token; |
| 9 | 9 |
| 10 /** | 10 /** |
| 11 * Key class used in [TokenMap] in which the hash code for a token is based | 11 * Key class used in [TokenMap] in which the hash code for a token is based |
| 12 * on the [charOffset]. | 12 * on the [charOffset]. |
| 13 */ | 13 */ |
| 14 class TokenKey { | 14 class TokenKey { |
| 15 final Token token; | 15 final Token token; |
| 16 TokenKey(this.token); | 16 TokenKey(this.token); |
| 17 int get hashCode => token.charOffset; | 17 int get hashCode => token.charOffset; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 38 Token operator[] (Token key) { | 38 Token operator[] (Token key) { |
| 39 if (key == null) return null; | 39 if (key == null) return null; |
| 40 return comments[new TokenKey(key)]; | 40 return comments[new TokenKey(key)]; |
| 41 } | 41 } |
| 42 | 42 |
| 43 void operator[]= (Token key, Token value) { | 43 void operator[]= (Token key, Token value) { |
| 44 if (key == null) return; | 44 if (key == null) return; |
| 45 comments[new TokenKey(key)] = value; | 45 comments[new TokenKey(key)] = value; |
| 46 } | 46 } |
| 47 } | 47 } |
| OLD | NEW |