0001 // 0002 // Structure.swift 0003 // SourceKitten 0004 // 0005 // Created by JP Simard on 2015-01-06. 0006 // Copyright (c) 2015 SourceKitten. All rights reserved. 0007 // 0008 0009 import Foundation 0010 0011 /// Represents the structural information in a Swift source file. 0012 public struct Structure{ 0013 /// Structural information as an [String: SourceKitRepresentable]. 0014 public let dictionary
Structure.swift:39 extension Structure: CustomStringConvertible {Structure.swift:46 extension Structure: Equatable {}Structure.swift:56 public func ==(lhs: Structure, rhs: Structure) -> Bool {Structure.swift:56 public func ==(lhs: Structure, rhs: Structure) -> Bool {: [String: SourceKitRepresentable] 0015 0016 /** 0017 Create a Structure from a SourceKit `editor.open` response. 0018 0019 - parameter sourceKitResponse: SourceKit `editor.open` response. 0020 */ 0021 public init
Structure.swift:24 dictionary = sourceKitResponseStructure.swift:41 public var description: String { return toJSON(toAnyObject(dictionary)) }Structure.swift:57 return lhs.dictionary.isEqualTo(rhs.dictionary)Structure.swift:57 return lhs.dictionary.isEqualTo(rhs.dictionary)(sourceKitResponse: [String: SourceKitRepresentable]) { 0022 var sourceKitResponse = sourceKitResponse 0023 _ = sourceKitResponse.removeValueForKey(SwiftDocKey.SyntaxMap.rawValue) 0024 dictionary = sourceKitResponse 0025 } 0026 0027 /** 0028 Initialize a Structure by passing in a File. 0029 0030 - parameter file: File to parse for structural information. 0031 */ 0032 public init(file: File) { 0033 self.init(sourceKitResponse: Request.EditorOpen(file).send()) 0034 } 0035 } 0036 0037 // MARK: CustomStringConvertible 0038 0039 extension Structure: CustomStringConvertible { 0040 /// A textual JSON representation of `Structure`. 0041 public var description: String { return toJSON(toAnyObject(dictionary)) } 0042 } 0043 0044 // MARK: Equatable 0045 0046 extension Structure: Equatable {} 0047 0048 /** 0049 Returns true if `lhs` Structure is equal to `rhs` Structure. 0050 0051 - parameter lhs: Structure to compare to `rhs`. 0052 - parameter rhs: Structure to compare to `lhs`. 0053 0054 - returns: True if `lhs` Structure is equal to `rhs` Structure. 0055 */ 0056 public func ==(lhs: Structure, rhs: Structure) -> Bool { 0057 return lhs.dictionary.isEqualTo(rhs.dictionary) 0058 } 0059
Structure.swift:33 self.init(sourceKitResponse: Request.EditorOpen(file).send())