     }
 
     mutating func skipWhitespace() {
-        while let c = head() {
-            switch c {
+        while loc < input.count {
+            switch input[loc] {
             case Literal.SPACE, Literal.TAB, Literal.RETURN, Literal.NEWLINE:
                 ++loc
 

            }

            let key: String
            if head() == Literal.DOUBLE_QUOTE {
                switch decodeString() {
                case .Ok(let json):
                    key = json.string!

            }

            skipWhitespace()
            if loc < input.count && input[loc] == Literal.COLON {
                ++loc
            } else {
                return makeParseError("invalid object at position \(start) - missing `:` between key and value")
