anchor.diff:     * of formatting then there will only ever be one number being formatted
      * at a time. In languages with threads we'd need to pass this on the stack.
      */
  -  StringBuffer _buffer;
  +  final StringBuffer _buffer = new StringBuffer();
   
     /**
      * Create a number format that prints using [newPattern] as it applies in
  
positive.code:   }
  
    /** Variables used in [_parseTrunk] and [parseTrunkCharacter]. */
    var decimalPos;
    var digitLeftCount;
    var zeroDigitCount;
    var digitRightCount;
    var groupingCount;
    var trunk;
  
    /**
     * Parse the "trunk" portion of the pattern, the piece that doesn't include
     * positive or negative prefixes or suffixes.
     */
    String _parseTrunk() {
      decimalPos = -1;
      digitLeftCount = 0;
      zeroDigitCount = 0;
      digitRightCount = 0;
      groupingCount = -1;
  
      var loop = true;
      trunk = new StringBuffer();
      while (pattern.current != null && loop) {
        loop = parseTrunkCharacter();
      }
  
      if (zeroDigitCount == 0 && digitLeftCount > 0 && decimalPos >= 0) {
  
negative.code:  */
  class _StringIterator implements Iterator<String> {
    final String input;
    int nextIndex = 0;
    String _current = null;
  
    _StringIterator(input) : input = _validate(input);
  
    String get current => _current;
  
    bool moveNext() {
      if (nextIndex >= input.length) {
        _current = null;
        return false;
      }
      _current = input[nextIndex++];
      return true;
    }
  
    String get peek => nextIndex >= input.length ? null : input[nextIndex];
  
    Iterator<String> get iterator => this;
  
    static String _validate(input) {
      if (input is! String) throw new ArgumentError(input);
      return input;
    }
  
  }
  