| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 analyzer.src.dart.ast.utilities; | 5 library analyzer.src.dart.ast.utilities; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/ast/token.dart'; | 10 import 'package:analyzer/dart/ast/token.dart'; |
| (...skipping 2299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2310 return list; | 2310 return list; |
| 2311 } | 2311 } |
| 2312 | 2312 |
| 2313 @override | 2313 @override |
| 2314 Object visitMapLiteral(MapLiteral node) { | 2314 Object visitMapLiteral(MapLiteral node) { |
| 2315 HashMap<String, Object> map = new HashMap<String, Object>(); | 2315 HashMap<String, Object> map = new HashMap<String, Object>(); |
| 2316 for (MapLiteralEntry entry in node.entries) { | 2316 for (MapLiteralEntry entry in node.entries) { |
| 2317 Object key = entry.key.accept(this); | 2317 Object key = entry.key.accept(this); |
| 2318 Object value = entry.value.accept(this); | 2318 Object value = entry.value.accept(this); |
| 2319 if (key is String && !identical(value, NOT_A_CONSTANT)) { | 2319 if (key is String && !identical(value, NOT_A_CONSTANT)) { |
| 2320 map[(key as String)] = value; | 2320 map[key] = value; |
| 2321 } else { | 2321 } else { |
| 2322 return NOT_A_CONSTANT; | 2322 return NOT_A_CONSTANT; |
| 2323 } | 2323 } |
| 2324 } | 2324 } |
| 2325 return map; | 2325 return map; |
| 2326 } | 2326 } |
| 2327 | 2327 |
| 2328 @override | 2328 @override |
| 2329 Object visitMethodInvocation(MethodInvocation node) => visitNode(node); | 2329 Object visitMethodInvocation(MethodInvocation node) => visitNode(node); |
| 2330 | 2330 |
| (...skipping 5455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7786 * Safely visit the given [token], printing the [suffix] after the token if it | 7786 * Safely visit the given [token], printing the [suffix] after the token if it |
| 7787 * is non-`null`. | 7787 * is non-`null`. |
| 7788 */ | 7788 */ |
| 7789 void _visitTokenWithSuffix(Token token, String suffix) { | 7789 void _visitTokenWithSuffix(Token token, String suffix) { |
| 7790 if (token != null) { | 7790 if (token != null) { |
| 7791 _writer.print(token.lexeme); | 7791 _writer.print(token.lexeme); |
| 7792 _writer.print(suffix); | 7792 _writer.print(suffix); |
| 7793 } | 7793 } |
| 7794 } | 7794 } |
| 7795 } | 7795 } |
| OLD | NEW |