     }
 }
 
+// MARK: - Errors
+
+/// Errors raised while parsing JSON data.
 public enum JSONParseError: ErrorType {
+    /// Some unknown error, usually indicates something not yet implemented.
     case Unknown
+    /// Input data was either empty or contained only whitespace.
     case EmptyInput
+    /// Some character that violates the strict JSON grammar was found.
     case UnexpectedCharacter(lineNumber: UInt, characterNumber: UInt)
+    /// A JSON string was opened but never closed.
     case UnterminatedString
+    /// Any unicode parsing errors will result in this error. Currently unused.
     case InvalidUnicode
+    /// A keyword, like `null`, `true`, or `false` was expected but something else was in the input.
     case UnexpectedKeyword(lineNumber: UInt, characterNumber: UInt)
+    /// Encountered a JSON number that couldn't be losslessly stored in a `Double` or `Int64`.
+    /// Usually the number is too large or too small.
     case InvalidNumber(lineNumber: UInt, characterNumber: UInt)
+    /// End of file reached, not always an actual error.
     case EndOfFile
 }
 
 extension JSONParseError: CustomStringConvertible {
+    /// Returns a `String` version of the error which can be logged.
+    /// Not currently localized.
     public var description: String {
         switch self {
         case .Unknown:

        }
    }
    
    public var object: [String : JSONValue]? {
        get {
            switch self {

        return JSONValue.JSONNull
    }
}


private let leftSquareBracket = UnicodeScalar(0x005b)
private let leftCurlyBracket = UnicodeScalar(0x007b)
private let rightSquareBracket = UnicodeScalar(0x005d)
private let rightCurlyBracket = UnicodeScalar(0x007d)
private let colon = UnicodeScalar(0x003A)
private let comma = UnicodeScalar(0x002C)
private let zeroScalar = "0".unicodeScalars.first!
private let negativeScalar = "-".unicodeScalars.first!
private let plusScalar = "+".unicodeScalars.first!
private let decimalScalar = ".".unicodeScalars.first!
private let quotationMark = UnicodeScalar(0x0022)
private let carriageReturn = UnicodeScalar(0x000D)
private let lineFeed = UnicodeScalar(0x000A)

// String escapes
private let reverseSolidus = UnicodeScalar(0x005C)
private let solidus = UnicodeScalar(0x002F)
private let backspace = UnicodeScalar(0x0008)
private let formFeed = UnicodeScalar(0x000C)
private let tabCharacter = UnicodeScalar(0x0009)

private let trueToken = [UnicodeScalar]("true".unicodeScalars)
private let falseToken = [UnicodeScalar]("false".unicodeScalars)
private let nullToken = [UnicodeScalar]("null".unicodeScalars)

private let escapeMap = [
    "/".unicodeScalars.first!: solidus,
    "b".unicodeScalars.first!: backspace,
    "f".unicodeScalars.first!: formFeed,
    "n".unicodeScalars.first!: lineFeed,
    "r".unicodeScalars.first!: carriageReturn,
    "t".unicodeScalars.first!: tabCharacter
]
