 private let asciiLowerT = UInt8(ascii: "t")
 private let asciiLowerV = UInt8(ascii: "v")
 
+private let tabSize = 2
+
 /// TextFormatEncoder has no public members.
 internal struct TextFormatEncoder {
     private var data = [UInt8]()
-    private var tabLevel = 0
+    private var indent: [UInt8] = []
     var stringResult: String {
         get {
             return String(bytes: data, encoding: String.Encoding.utf8)!

    }

    mutating func startObject() {
        tabLevel += 1
        data.append(asciiOpenCurlyBracket)
        data.append(asciiNewline)
    }

    mutating func endObject() {
        tabLevel -= 1
        for _ in 0..<tabLevel {
            data.append(asciiSpace)
            data.append(asciiSpace)
        }
        data.append(asciiCloseCurlyBracket)
    }


    init() {}

    private mutating func appendFieldName(name: StaticString, inExtension: Bool) {
        data.append(contentsOf: indent)
        if inExtension {
            data.append(asciiOpenSquareBracket)
        }
