             }
         }
 
-        return .Ok(.Double(Double(sign.rawValue) * value))
-    }
-
-    private mutating func decodeNumberExponent(start: Int, sign: Sign, value: Double) -> Result {
+        return .Success(.Double(Double(sign.rawValue) * value))
+    }
+
+    private mutating func decodeNumberExponent(start: Int, sign: Sign, value: Double) -> Result<JSON, NSError> {
         if ++loc >= input.count {
             return makeParseError("unexpected end of data while parsing number at position \(start)")
         }

        }
    }

    private mutating func decodeNull() -> Result {
        if loc + 4 > input.count {
            return makeParseError("invalid token at position \(loc) - expected `null`")
        }

import Result

// TODO: use error types
private func makeParseError(reason: String) -> Result<JSON, NSError> {
    return .Failure(JSON.makeError(.CouldNotParseJSON, problem: reason))
}
