                 groupIndexes = [2, 3]
             }
 
-            for idx in groupIndexes where kindsInCaptureGroups[idx] != [.identifier] {
+            for idx in groupIndexes where !Set(kindsInCaptureGroups[idx]).isSubset(of: [.identifier, .keyword]) {
                 return nil
             }
 
+            let byteRange = byteRanges[groupIndexes[0]]!
             return StyleViolation(ruleDescription: type(of: self).description,
                                   severity: configuration.severity,
-                                  location: Location(file: file, characterOffset: match.range.location))
+                                  location: Location(file: file, byteOffset: byteRange.location))
         }
     }
 }

//  Copyright © 2017 Realm. All rights reserved.
//

import SourceKittenFramework

public struct ShorthandOperatorRule: ConfigurationProviderRule {

            [
                "foo \(operation)= 1",
                "foo \(operation)= variable",
                "foo \(operation)= bar.method()",
                "self.foo = foo \(operation) 1",
                "foo = self.foo \(operation) 1"
            ]
        },
        triggeringExamples: allOperators.flatMap { operation in
