anchor.diff:  
     // write the content
     resourcesFile.writeAsStringSync(content);
  +}
  +
  +void fail(String message) {
  +  stderr.writeln(message);
  +  exit(1);
  +}
  +
  +/// Fail the script, and print out a message indicating how to regenerate the
  +/// resources file.
  +void failGenerate(String message) {
  +  stderr.writeln('$message.');
  +  stderr.writeln();
  +  stderr.writeln('''
  +To re-generate lib/src/edit/nnbd_migration/resources/resources.g.dart, run:
  +
  +  dart pkg/analysis_server/tool/nnbd_migration/generate_resources.dart
  +''');
  +  exit(1);
   }
   
   String generateResourceFile(Iterable<File> resources) {
  
positive.code:   return md5.convert(str.codeUnits).toString();
  }
  
  String base64Encode(List<int> bytes) {
    String encoded = base64.encode(bytes);
  
    // Logic to cut lines into 80-character chunks.
    var lines = <String>[];
    var index = 0;
  
    while (index < encoded.length) {
      var line = encoded.substring(index, math.min(index + 80, encoded.length));
      lines.add(line);
      index += line.length;
    }
  
    return lines.join('\n');
  }
  
  void compileWebFrontEnd() async {
    String sdkBinDir = path.dirname(Platform.resolvedExecutable);
    String dart2jsPath = path.join(sdkBinDir, 'dart2js');
  
    const minified = true;
  
    // dart2js -m -o output source
    Process process = await Process.start(dart2jsPath, [
      if (minified) '-m',
      '--no-frequency-based-minification',
      '-o',
      javascriptOutput.path,
      dartSources.path,
    ]);
    process.stdout.listen((List<int> data) => stdout.add(data));
    process.stderr.listen((List<int> data) => stderr.add(data));
    int exitCode = await process.exitCode;
  
    if (exitCode != 0) {
      fail('Failed compiling ${dartSources.path}.');
    }
  }
  
  void fail(String message) {
    stderr.writeln(message);
    exit(1);
  }
  
  /// Fail the script, and print out a message indicating how to regenerate the
  /// resources file.
  void failGenerate(String message) {
    stderr.writeln('$message.');
    stderr.writeln();
    stderr.writeln('''
  To re-generate lib/src/edit/nnbd_migration/resources/resources.g.dart, run:
  
    dart pkg/analysis_server/tool/nnbd_migration/generate_resources.dart
  ''');
    exit(1);
  }
  
negative.code:   }
  }
  
  final File dartSources = File(path.join('pkg', 'analysis_server', 'lib', 'src',
      'edit', 'nnbd_migration', 'web', 'migration.dart'));
  final javascriptOutput = File(path.join('pkg', 'analysis_server', 'lib', 'src',
      'edit', 'nnbd_migration', 'resources', 'migration.js'));
  
  final Directory resourceDir = Directory(path.join('pkg', 'analysis_server',
      'lib', 'src', 'edit', 'nnbd_migration', 'resources'));
  final File resourcesFile = File(path.join('pkg', 'analysis_server', 'lib',
      'src', 'edit', 'nnbd_migration', 'resources', 'resources.g.dart'));
  
  final List<String> resourceTypes = [
    '.css',
  