anchor.diff:  }
   
   main(List<String> arguments) {
  +  poiCount = 0;
  +  List<String> nonOptionArguments = [];
  +  for (String argument in arguments) {
  +    if (argument.startsWith('-')) {
  +      switch (argument) {
  +        case '--simulate-mutation':
  +          isSimulateMutationEnabled = true;
  +          break;
  +        default:
  +          throw 'Unknown option: $argument.';
  +      }
  +    } else {
  +      nonOptionArguments.add(argument);
  +    }
  +  }
  +  if (nonOptionArguments.isEmpty) {
  +    stdin = new StdinIterator();
  +  } else {
  +    stdin = nonOptionArguments.iterator;
  +  }
  +
     FormattingDiagnosticHandler handler = new FormattingDiagnosticHandler();
     handler
         ..verbose = false
         ..enableColors = true;
     api.CompilerInputProvider inputProvider = handler.provider;
   
  -  if (arguments.length == 0) {
  -    stdin = new StdinIterator();
  -  } else {
  -    stdin = arguments.where((String line) {
  -      print(line); // Simulates user input in terminal.
  -      return true;
  -    }).iterator;
  -  }
  -
     return prompt('Dart file: ').then((String fileName) {
  +    if (isSimulateMutationEnabled) {
  +      inputProvider = simulateMutation(fileName, inputProvider);
  +    }
       return prompt('Position: ').then((String position) {
         return parseUserInput(fileName, position, inputProvider, handler);
       });
     });
   }
   
  +/// Create an input provider that implements the behavior documented at
  +/// [simulateMutation].
  +api.CompilerInputProvider simulateMutation(
  +    String fileName,
  +    SourceFileProvider inputProvider) {
  +  Uri script = Uri.base.resolveUri(new Uri.file(fileName));
  +  int count = poiCount;
  +  Future cache;
  +  String cachedFileName = script.toFilePath();
  +  int counter = ++globalCounter;
  +  return (Uri uri) {
  +    if (counter != globalCounter) throw 'Using old provider';
  +    print('fake inputProvider#$counter($uri): $poiCount $count');
  +    if (uri == script) {
  +      if (poiCount == count) {
  +        cachedFileName = uri.toFilePath();
  +        if (count != 0) {
  +          cachedFileName = '$cachedFileName.$count.dart';
  +        }
  +        print('Not using cached version of $cachedFileName');
  +        cache = new File(cachedFileName).readAsBytes().then((data) {
  +          print('Read file $cachedFileName: ${UTF8.decode(data)}');
  +          return data;
  +        });
  +        count++;
  +      } else {
  +        print('Using cached version of $cachedFileName');
  +      }
  +      return cache;
  +    } else {
  +      print('Using realProvider for $uri');
  +      return inputProvider(uri);
  +    }
  +  };
  +}
  +
   Future<String> prompt(message) {
  -  stdout.write(message);
  +  if (stdin is StdinIterator) {
  +    stdout.write(message);
  +  }
     return stdout.flush().then((_) {
       stdin.moveNext();
       return stdin.current;
  
positive.code: /// Iterator over lines from standard input (or the argument array).
  Iterator<String> stdin;
  
  /// Iterator for reading lines from [io.stdin].
  class StdinIterator implements Iterator<String> {
    String current;
  
negative.code: 
    Future future = runPoi(script, position, inputProvider, handler);
    return future.then((Element element) {
      poiCount++;
      print('Resolving took ${sw.elapsedMicroseconds}us.');
      sw.reset();
      String info = scopeInformation(element, position);
  