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

Side by Side Diff: pkg/front_end/tool/_fasta/generate_messages.dart

Issue 2767633004: Report compile-time errors on cyclic hierarchies. (Closed)
Patch Set: Created 3 years, 9 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
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698