| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'dart:io'; | 5 import 'dart:io'; |
| 6 | 6 |
| 7 import 'dart:isolate'; | 7 import 'dart:isolate'; |
| 8 | 8 |
| 9 import 'dart:convert'; | |
| 10 | |
| 11 import 'package:yaml/yaml.dart' show loadYaml; | 9 import 'package:yaml/yaml.dart' show loadYaml; |
| 12 | 10 |
| 13 import 'package:front_end/src/fasta/parser/error_kind.dart' show ErrorKind; | 11 import 'package:front_end/src/fasta/parser/error_kind.dart' show ErrorKind; |
| 14 | 12 |
| 15 main(List<String> arguments) async { | 13 main(List<String> arguments) async { |
| 16 var port = new ReceivePort(); | 14 var port = new ReceivePort(); |
| 17 Uri messagesFile = Platform.script.resolve("../../messages.yaml"); | 15 Uri messagesFile = Platform.script.resolve("../../messages.yaml"); |
| 18 Map yaml = loadYaml(await new File.fromUri(messagesFile).readAsStringSync()); | 16 Map yaml = loadYaml(await new File.fromUri(messagesFile).readAsStringSync()); |
| 19 Set<String> names = | 17 Set<String> names = |
| 20 new Set<String>.from(yaml.keys.map((String s) => "ErrorKind.$s")); | 18 new Set<String>.from(yaml.keys.map((String s) => "ErrorKind.$s")); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 ${interpolate('message', template)} | 110 ${interpolate('message', template)} |
| 113 ${interpolate('tip', tip)} | 111 ${interpolate('tip', tip)} |
| 114 'code': ErrorKind.$name, | 112 'code': ErrorKind.$name, |
| 115 'arguments': { | 113 'arguments': { |
| 116 ${arguments.join('\n ')} | 114 ${arguments.join('\n ')} |
| 117 }, | 115 }, |
| 118 }; | 116 }; |
| 119 } | 117 } |
| 120 """; | 118 """; |
| 121 } | 119 } |
| OLD | NEW |