 
     func consumeWhitespace(input: Index) -> Index? {
         var index = input
-        while let char = source.peekASCII(index) where JSONReader.whitespaceASCII.contains(char) {
-            index += source.step
+        while let (char, nextIndex) = source.takeASCII(index) where JSONReader.whitespaceASCII.contains(char) {
+            index = nextIndex
         }
         return index
     }

            }()
        }

        func peekASCII(input: Index) -> UInt8? {
            guard hasNext(input) else {
                return nil
            }

            default:
                return nil
            }
            return (buffer[index] < 0x80) ? (buffer[index], input + step) : nil
        }

        func takeString(begin: Index, end: Index) throws -> String {
