         if scanner.next() == nil {
             return nil
         }
-        strbuf.clear()
+        strbuf.removeAll(keepCapacity: true)
         Loop: while currentChar != nil {
             switch currentChar! {
             case 92:

    }
}

private struct StringBuilder {
    
    var buf: [UInt8]
    
    init() {
        self.buf = [UInt8]()
    }
    
    mutating func append(x: UInt8) {
        buf.append(x)
    }
    
    mutating func append(escape x: UInt8) -> Bool {
        switch x {
        case 34, 39, 47, 92:
            buf.append(x)
        case 116:
            buf.append(9)
        case 114:
            buf.append(13)
        case 110:
            buf.append(10)
        default:
            return false
        }
        return true
    }
    
    mutating func clear() {
        buf.removeAll(keepCapacity: true)
    }
    
    mutating func getString() -> String? {
        buf.append(0)
        return String.fromCString(UnsafePointer(buf))
    }
}

private struct JsonParser {
    
    var strbuf: StringBuilder
    var scanner: CharacterScanner
    
    init(bytes: UnsafePointer<UInt8>, count: Int) {
        self.strbuf = StringBuilder()
        self.scanner = CharacterScanner(bytes: bytes, count: count)
        self.scanner.next()
    }

    }
    
    mutating func skipWhitespaces() throws {
        Loop: while currentChar != nil {
            switch currentChar! {
            case 9, 10, 13, 32: scanner.next()
            default: break Loop
            }
        }
        if currentChar == nil {
            throw JsonParseError.UnexpectedEndOfToken
