 }
 
 
-
-
-public protocol JSONPathComponent {}
-extension String : JSONPathComponent {}
-extension Int : JSONPathComponent {}
-
-public struct JSONPath : CustomStringConvertible {
+public enum JSONPathComponent : IntegerLiteralConvertible,StringLiteralConvertible,Equatable {
+    case Key(String)
+    case Index(Int)
+    init(_ value: String) {
+        self = .Key(value)
+    }
+    init(_ value: Int) {
+        self = Index(value)
+    }
+    public init(integerLiteral value: IntegerLiteralType) {
+        self.init(value)
+    }
+    public init(stringLiteral value: StringLiteralType) {
+        self.init(String(value))
+    }
+    public typealias UnicodeScalarLiteralType = StringLiteralType
+    public init(unicodeScalarLiteral value: UnicodeScalarLiteralType) {
+        self.init(stringLiteral : value)
+    }
+    public typealias ExtendedGraphemeClusterLiteralType = StringLiteralType
+    public init(extendedGraphemeClusterLiteral value: ExtendedGraphemeClusterLiteralType) {
+        self.init(stringLiteral : value)
+    }
+}
+
+public struct JSONPath : CustomStringConvertible, Equatable {
     public var description: String {
         return self.content.map{String($0)}.joinWithSeparator("/")
     }


}

public func +(var lhs: JSONPath, rhs: JSONPath) -> JSONPath {
    lhs.append(rhs)
    return lhs
}
public func +(var lhs: JSONPath, rhs: JSONPathComponent) -> JSONPath {
    lhs.append(rhs)
    return lhs
}


        self.content = []
    }
    public init(_ component: String) {
        self.content = [JSONPathComponent(component)]
    }
    public init(_ component: Int) {
        self.content = [JSONPathComponent(component)]
    }
    public init(_ path: JSONPath) {
        self.content = path.content
