 
 private struct QuoteCommentItem {
     
-    let location: Int
-    let length: Int
     let kind: String
     let role: Role
+    let range: NSRange
     
     
     enum Kind {

                    highlights[syntaxType] = [range]
                }
                
                searchingPairKind = nil
                seekLocation = endLocation
                continue
            }
            
            if startLocation < parseRange.max {
                isContinued = true
            }
        }
        
        // highlight until the end if not closed
        if let searchingPairKind = searchingPairKind, isContinued {
            let syntaxType = self.pairedQuoteTypes[searchingPairKind] ?? SyntaxType.comments
            let range = NSRange(location: startLocation, length: parseRange.max - startLocation)
            
            if highlights[syntaxType] != nil {
                highlights[syntaxType]!.append(range)

        var positions = [QuoteCommentItem]()
        
        if let delimiters = self.blockCommentDelimiters {
            for range in self.ranges(string: delimiters.begin) {
                positions.append(QuoteCommentItem(kind: QuoteCommentItem.Kind.blockComment,
                                                  role: .start,
                                                  range: range))
            }
            for range in self.ranges(string: delimiters.end) {
                positions.append(QuoteCommentItem(kind: QuoteCommentItem.Kind.blockComment,
                                                  role: .end,
                                                  range: range))
            }
        }
        
        if let delimiter = self.inlineCommentDelimiter {
            for range in self.ranges(string: delimiter) {
                let lineRange = (self.string! as NSString).lineRange(for: range)
                
                positions.append(QuoteCommentItem(kind: QuoteCommentItem.Kind.inlineComment,
                                                  role: .start,
                                                  range: range))
                positions.append(QuoteCommentItem(kind: QuoteCommentItem.Kind.inlineComment,
                                                  role: .end,
                                                  range: NSRange(location: lineRange.max, length: 0)))
            }
        }
        
        for quote in self.pairedQuoteTypes.keys {
            for range in self.ranges(string: quote) {
                positions.append(QuoteCommentItem(kind: quote,
                                                  role: [.start, .end],
                                                  range: range))
            }
        }
        
        guard !positions.isEmpty else { return [:] }
        
        // sort by location
        positions.sort {
            if $0.range.location < $1.range.location { return true }
            if $0.range.location > $1.range.location { return false }
            
            if $0.role.rawValue == $1.role.rawValue {
                return $0.range.length > $1.range.length
            }
            return $0.role.rawValue < $1.role.rawValue
        }
        
        // scan quoted strings and comments in the parse range
        var highlights = [SyntaxType: [NSRange]]()
        var startLocation = 0
        var seekLocation = self.parseRange.location
        var searchingKind: String?
        
        for position in positions {
            // search next begin delimiter
            guard let kind = searchingKind else {
                if position.role.contains(.start), position.range.location >= seekLocation {
                    searchingKind = position.kind
                    startLocation = position.range.location
                }
                continue
            }
            
            // search corresponding end delimiter
            if position.role.contains(.end), position.kind == kind {
                let endLocation = position.range.max
                let syntaxType = self.pairedQuoteTypes[kind] ?? SyntaxType.comments
                let range = NSRange(location: startLocation, length: endLocation - startLocation)
                
