anchor.diff:  
   const _usage =
       "Usage: dart update_static_error_tests.dart [flags...] <path glob>";
  +
  +final String _analyzerPath = _findAnalyzer();
   
   Future<void> main(List<String> args) async {
     var sources = ErrorSource.all.map((e) => e.marker).toList();
  
positive.code:   // TODO(rnystrom): Running the analyzer command line each time is very slow.
    // Either import the analyzer as a library, or at least invoke it in a batch
    // mode.
    var result = await Process.run(
        Platform.isWindows
            ? "sdk\\bin\\dartanalyzer.bat"
            : "sdk/bin/dartanalyzer",
        [
          ...options,
          "--format=machine",
          path,
        ]);
  
    // Analyzer returns 3 when it detects errors, 2 when it detects
    // warnings and --fatal-warnings is enabled, 1 when it detects
  
negative.code:   FastaCommandOutput.parseErrors(result.stdout as String, errors);
    return errors;
  }
  
  /// Find the most recently-built analyzer.
  String _findAnalyzer() {
    String newestAnalyzer;
    DateTime newestAnalyzerTime;
  
    var buildDirectory = Directory(Platform.isMacOS ? "xcodebuild" : "out");
    if (buildDirectory.existsSync()) {
      for (var config in buildDirectory.listSync()) {
        var analyzerPath = p.join(config.path, "dart-sdk", "bin", "dartanalyzer");
        var analyzerFile = File(analyzerPath);
        if (!analyzerFile.existsSync()) continue;
        var modified = analyzerFile.lastModifiedSync();
  
        if (newestAnalyzerTime == null || modified.isAfter(newestAnalyzerTime)) {
          newestAnalyzer = analyzerPath;
          newestAnalyzerTime = modified;
        }
      }
    }
  
    if (newestAnalyzer == null) {
      // Clear the current line since we're in the middle of a progress line.
      print("");
      print("Could not find a built SDK with a dartanalyzer to run.");
      print("Make sure to build the Dart SDK before running this tool.");
      exit(1);
    }
  
    return newestAnalyzer;
  }
  