Skip to content

Commit 5f0fc5c

Browse files
stereotype441Commit Queue
authored andcommitted
[messages] Remove _SyntacticErrorGenerator.checkForManualChanges.
Removes the method `_SyntacticErrorGenerator.checkForManualChanges`, which was part of a previous effort to unify analyzer and CFE error codes, and is not needed by the current effort. Removing this method will make it easier to clean up and refactor the logic for handling shared error codes. Change-Id: I6a6a6964721c4ad0d4ca7336a97346681d476781 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/451825 Commit-Queue: Paul Berry <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]> Reviewed-by: Samuel Rawlins <[email protected]>
1 parent 2f2e251 commit 5f0fc5c

File tree

1 file changed

+1
-33
lines changed

1 file changed

+1
-33
lines changed

pkg/analyzer/tool/messages/generate.dart

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ import 'error_code_info.dart';
3131
Future<void> main() async {
3232
await GeneratedContent.generateAll(pkg_root.packageRoot, allTargets);
3333

34-
_SyntacticErrorGenerator()
35-
..checkForManualChanges()
36-
..printSummary();
34+
_SyntacticErrorGenerator().printSummary();
3735
}
3836

3937
/// A list of all targets generated by this code generator.
@@ -327,36 +325,6 @@ class _SyntacticErrorGenerator {
327325

328326
_SyntacticErrorGenerator._(this.errorConverterSource, this.parserSource);
329327

330-
void checkForManualChanges() {
331-
// Check for ParserErrorCodes that could be removed from
332-
// error_converter.dart now that those ParserErrorCodes are auto generated.
333-
int converterCount = 0;
334-
for (var errorCode
335-
in sharedToAnalyzerErrorCodeTables.infoToAnalyzerCode.values) {
336-
if (errorConverterSource.contains('"$errorCode"')) {
337-
if (converterCount == 0) {
338-
print('');
339-
print(
340-
'The following ParserErrorCodes could be removed'
341-
' from error_converter.dart:',
342-
);
343-
}
344-
print(' $errorCode');
345-
++converterCount;
346-
}
347-
}
348-
if (converterCount > 3) {
349-
print(' $converterCount total');
350-
}
351-
352-
// Fail if there are manual changes to be made, but do so
353-
// in a fire and forget manner so that the files are still generated.
354-
if (converterCount > 0) {
355-
print('');
356-
throw 'Error: missing manual code changes';
357-
}
358-
}
359-
360328
void printSummary() {
361329
// Build a map of error message to ParserErrorCode
362330
var messageToName = <String, String>{};

0 commit comments

Comments
 (0)