anchor.diff:      // Break this block when the end of the number literal is reached.
       // At that time, position points to the next character, and isDouble
       // is set if the literal contains a decimal point or an exponential.
  -    parsing: {
  -      if (char == MINUS) {
  -        sign = -1;
  +    if (char == MINUS) {
  +      sign = -1;
  +      position++;
  +      if (position == length) return beginChunkNumber(NUM_SIGN, start);
  +      char = getChar(position);
  +    }
  +    int digit = char ^ CHAR_0;
  +    if (digit > 9) {
  +      if (sign < 0) {
  +        fail(position, "Missing expected digit");
  +      } else {
  +        // If it doesn't even start out as a numeral.
  +        fail(position, "Unexpected character");
  +      }
  +    }
  +    if (digit == 0) {
  +      position++;
  +      if (position == length) return beginChunkNumber(NUM_ZERO, start);
  +      char = getChar(position);
  +      digit = char ^ CHAR_0;
  +      // If starting with zero, next character must not be digit.
  +      if (digit <= 9) fail(position);
  +    } else {
  +      do {
  +        intValue = 10 * intValue + digit;
           position++;
  -        if (position == length) return beginChunkNumber(NUM_SIGN, start);
  -        char = getChar(position);
  -      }
  -      int digit = char ^ CHAR_0;
  -      if (digit > 9) {
  -        if (sign < 0) {
  -          fail(position, "Missing expected digit");
  -        } else {
  -          // If it doesn't even start out as a numeral.
  -          fail(position, "Unexpected character");
  -        }
  -      }
  -      if (digit == 0) {
  -        position++;
  -        if (position == length) return beginChunkNumber(NUM_ZERO, start);
  +        if (position == length) return beginChunkNumber(NUM_DIGIT, start);
           char = getChar(position);
           digit = char ^ CHAR_0;
  -        // If starting with zero, next character must not be digit.
  -        if (digit <= 9) fail(position);
  -      } else {
  -        do {
  -          intValue = 10 * intValue + digit;
  -          position++;
  -          if (position == length) return beginChunkNumber(NUM_DIGIT, start);
  -          char = getChar(position);
  -          digit = char ^ CHAR_0;
  -        } while (digit <= 9);
  -      }
  -      if (char == DECIMALPOINT) {
  -        isDouble = true;
  +      } while (digit <= 9);
  +    }
  +    if (char == DECIMALPOINT) {
  +      isDouble = true;
  +      doubleValue = intValue.toDouble();
  +      intValue = 0;
  +      position++;
  +      if (position == length) return beginChunkNumber(NUM_DOT, start);
  +      char = getChar(position);
  +      digit = char ^ CHAR_0;
  +      if (digit > 9) fail(position);
  +      do {
  +        doubleValue = 10.0 * doubleValue + digit;
  +        intValue -= 1;
  +        position++;
  +        if (position == length) return beginChunkNumber(NUM_DOT_DIGIT, start);
  +        char = getChar(position);
  +        digit = char ^ CHAR_0;
  +      } while (digit <= 9);
  +    }
  +    if ((char | 0x20) == CHAR_e) {
  +      if (!isDouble) {
           doubleValue = intValue.toDouble();
           intValue = 0;
  +        isDouble = true;
  +      }
  +      position++;
  +      if (position == length) return beginChunkNumber(NUM_E, start);
  +      char = getChar(position);
  +      int expSign = 1;
  +      int exponent = 0;
  +      if (char == PLUS || char == MINUS) {
  +        expSign = 0x2C - char;  // -1 for MINUS, +1 for PLUS
           position++;
  -        if (position == length) return beginChunkNumber(NUM_DOT, start);
  +        if (position == length) return beginChunkNumber(NUM_E_SIGN, start);
  +        char = getChar(position);
  +      }
  +      digit = char ^ CHAR_0;
  +      if (digit > 9) {
  +        fail(position, "Missing expected digit");
  +      }
  +      do {
  +        exponent = 10 * exponent + digit;
  +        position++;
  +        if (position == length) return beginChunkNumber(NUM_E_DIGIT, start);
           char = getChar(position);
           digit = char ^ CHAR_0;
  -        if (digit > 9) fail(position);
  -        do {
  -          doubleValue = 10.0 * doubleValue + digit;
  -          intValue -= 1;
  -          position++;
  -          if (position == length) return beginChunkNumber(NUM_DOT_DIGIT, start);
  -          char = getChar(position);
  -          digit = char ^ CHAR_0;
  -        } while (digit <= 9);
  -      }
  -      if ((char | 0x20) == CHAR_e) {
  -        if (!isDouble) {
  -          doubleValue = intValue.toDouble();
  -          intValue = 0;
  -          isDouble = true;
  -        }
  -        position++;
  -        if (position == length) return beginChunkNumber(NUM_E, start);
  -        char = getChar(position);
  -        int expSign = 1;
  -        int exponent = 0;
  -        if (char == PLUS || char == MINUS) {
  -          expSign = 0x2C - char;  // -1 for MINUS, +1 for PLUS
  -          position++;
  -          if (position == length) return beginChunkNumber(NUM_E_SIGN, start);
  -          char = getChar(position);
  -        }
  -        digit = char ^ CHAR_0;
  -        if (digit > 9) {
  -          fail(position, "Missing expected digit");
  -        }
  -        do {
  -          exponent = 10 * exponent + digit;
  -          position++;
  -          if (position == length) return beginChunkNumber(NUM_E_DIGIT, start);
  -          char = getChar(position);
  -          digit = char ^ CHAR_0;
  -        } while (digit <= 9);
  -        intValue += expSign * exponent;
  -      }
  +      } while (digit <= 9);
  +      intValue += expSign * exponent;
       }
       if (!isDouble) {
         listener.handleNumber(sign * intValue);
  
positive.code:   static const int RBRACE          = 0x7d;
  
    // State of partial value at chunk split.
    static const int NO_PARTIAL      = 0;
    static const int PARTIAL_STRING  = 1;
    static const int PARTIAL_NUMERAL = 2;
    static const int PARTIAL_KEYWORD = 3;
    static const int MASK_PARTIAL    = 3;
  
    // Partial states for numerals. Values can be |'ed with PARTIAL_NUMERAL.
    static const int NUM_SIGN        =  0;  // After initial '-'.
    static const int NUM_ZERO        =  4;  // After '0' as first digit.
    static const int NUM_DIGIT       =  8;  // After digit, no '.' or 'e' seen.
    static const int NUM_DOT         = 12;  // After '.'.
    static const int NUM_DOT_DIGIT   = 16;  // After a decimal digit (after '.').
    static const int NUM_E           = 20;  // After 'e' or 'E'.
    static const int NUM_E_SIGN      = 24;  // After '-' or '+' after 'e' or 'E'.
    static const int NUM_E_DIGIT     = 28;  // After exponent digit.
    static const int NUM_SUCCESS     = 32;  // Never stored as partial state.
  
    // Partial states for strings.
    static const int STR_PLAIN         =  0;   // Inside string, but not escape.
    static const int STR_ESCAPE        =  4;   // After '\'.
    static const int STR_U             =  16;  // After '\u' and 0-3 hex digits.
    static const int STR_U_COUNT_SHIFT =  2;   // Hex digit count in bits 2-3.
    static const int STR_U_VALUE_SHIFT =  5;   // Hex digit value in bits 5+.
  
    // Partial states for keywords.
    static const int KWD_TYPE_MASK     = 12;
    static const int KWD_TYPE_SHIFT    = 2;
    static const int KWD_NULL          = 0;  // Prefix of "null" seen.
    static const int KWD_TRUE          = 4;  // Prefix of "true" seen.
    static const int KWD_FALSE         = 8;  // Prefix of "false" seen.
    static const int KWD_COUNT_SHIFT   = 4;  // Prefix length in bits 4+.
  
    // Mask used to mask off two lower bits.
    static const int TWO_BIT_MASK = 3;
  
    final _JsonListener listener;
  
  
negative.code:   /**
     * Parses a "false" literal starting at [position].
     *
     * The character `source[position]` must be "f".
     */
    int parseFalse(int position) {
      assert(getChar(position) == CHAR_f);
  