     case InvalidNumber(lineNumber: UInt, characterNumber: UInt)
     /// End of file reached, not always an actual error.
     case EndOfFile
+}
+
+/// Errors raised while serializing to a JSON string
+public enum JSONSerializeError: ErrorType {
+    /// Some unknown error, usually indicates something not yet implemented.
+    case Unknown
+    /// A number not supported by the JSON spec was encounterd, like infinity or NaN.
+    case InvalidNumber
 }
 
 extension JSONParseError: CustomStringConvertible {

    }
}


private let leftSquareBracket = UnicodeScalar(0x005b)
private let leftCurlyBracket = UnicodeScalar(0x007b)

    "r".unicodeScalars.first!: carriageReturn,
    "t".unicodeScalars.first!: tabCharacter
]

private let hexScalars = [
    "0".unicodeScalars.first!,
    "1".unicodeScalars.first!,
    "2".unicodeScalars.first!,
    "3".unicodeScalars.first!,
    "4".unicodeScalars.first!,
    "5".unicodeScalars.first!,
    "6".unicodeScalars.first!,
    "7".unicodeScalars.first!,
    "8".unicodeScalars.first!,
    "9".unicodeScalars.first!,
    "a".unicodeScalars.first!,
    "b".unicodeScalars.first!,
    "c".unicodeScalars.first!,
    "d".unicodeScalars.first!,
    "e".unicodeScalars.first!,
    "f".unicodeScalars.first!
]
