anchor.diff:        if (char < CHAR_0 || char > CHAR_9) {
           fail(position, "Missing expected digit");
         }
  -      do {
  +      if (char == CHAR_0) {
           position++;
  -        if (position == length) return _handleLiteral(start, position, true);
  +        if (position == length) break parsing;
           char = source.codeUnitAt(position);
  -      } while (CHAR_0 <= char && char <= CHAR_9);
  -    }
  -    return _handleLiteral(start, position, isDouble);
  +        if (CHAR_0 <= char && char <= CHAR_9) {
  +          fail(position);
  +        }
  +      } else {
  +        do {
  +          intValue = intValue * 10 + (char - CHAR_0);
  +          position++;
  +          if (position == length) break parsing;
  +          char = source.codeUnitAt(position);
  +        } while (CHAR_0 <= char && char <= CHAR_9);
  +      }
  +      if (char == DECIMALPOINT) {
  +        isDouble = true;
  +        position++;
  +        if (position == length) fail(position, "Missing expected digit");
  +        char = source.codeUnitAt(position);
  +        if (char < CHAR_0 || char > CHAR_9) fail(position);
  +        do {
  +          position++;
  +          if (position == length) break parsing;
  +          char = source.codeUnitAt(position);
  +        } while (CHAR_0 <= char && char <= CHAR_9);
  +      }
  +      if (char == CHAR_e || char == CHAR_E) {
  +        isDouble = true;
  +        position++;
  +        if (position == length) fail(position, "Missing expected digit");
  +        char = source.codeUnitAt(position);
  +        if (char == PLUS || char == MINUS) {
  +          position++;
  +          if (position == length) fail(position, "Missing expected digit");
  +          char = source.codeUnitAt(position);
  +        }
  +        if (char < CHAR_0 || char > CHAR_9) {
  +          fail(position, "Missing expected digit");
  +        }
  +        do {
  +          position++;
  +          if (position == length) break parsing;
  +          char = source.codeUnitAt(position);
  +        } while (CHAR_0 <= char && char <= CHAR_9);
  +      }
  +    }
  +    if (!isDouble) {
  +      listener.handleNumber(intSign * intValue);
  +      return position;
  +    }
  +    // Consider whether we can have an int/double.parse that works on part of
  +    // a string, to avoid creating the substring.
  +    String literal = source.substring(start, position);
  +    // This correctly creates -0.0 for doubles.
  +    listener.handleNumber(double.parse(literal));
  +    return position;
     }
   
     void fail(int position, [String message]) {
  
positive.code:     return position + 4;
    }
  
    int parseString(int position) {
      // Format: '"'([^\x00-\x1f\\\"]|'\\'[bfnrt/\\"])*'"'
      // Initial position is right after first '"'.
      int start = position;
      int char;
      do {
        if (position == source.length) {
          fail(start - 1, "Unterminated string");
        }
        char = source.codeUnitAt(position);
        if (char == QUOTE) {
          listener.handleString(source.substring(start, position));
          return position + 1;
        }
        if (char < SPACE) {
          fail(position, "Control character in string");
        }
        position++;
      } while (char != BACKSLASH);
      // Backslash escape detected. Collect character codes for rest of string.
      int firstEscape = position - 1;
      List<int> chars = <int>[];
      while (true) {
        if (position == source.length) {
          fail(start - 1, "Unterminated string");
        }
        char = source.codeUnitAt(position);
        switch (char) {
          case CHAR_b: char = BACKSPACE; break;
          case CHAR_f: char = FORM_FEED; break;
  
negative.code:     return position + 5;
    }
  
    /**
     * Parses a "null" literal starting at [position].
     *
     * [:source[position]:] must be "n".
     */
  