         }
     }
 
+    private func tokenIsKeyword(token: SyntaxToken) -> Bool {
+        return SyntaxKind(rawValue: token.type) == .Keyword
+    }
+
     private func contentForToken(token: SyntaxToken, file: File) -> String {
         return file.contents.substringWithByteRange(start: token.offset,
                                                     length: token.length) ?? ""

    public func validateFile(file: File) -> [StyleViolation] {
        let pattern = "(case[^\n]*|default):[^\\S\n]*[^\n]+"
        return file.rangesAndTokensMatching(pattern).filter { range, tokens in
            guard let firstToken = tokens.first
                where SyntaxKind(rawValue: firstToken.type) == .Keyword else {
                    return false
            }

            let tokenString = contentForToken(firstToken, file: file)
            return ["case", "default"].contains(tokenString)
        }.map {
            StyleViolation(ruleDescription: self.dynamicType.description,
                severity: self.configuration.severity,

            "/*case 1: */return true",
            "//case 1:\n return true",
            "let x = [caseKey: value]",
            "let x = [key: .default]",
            "if case let .someEnum(value) = aFunction([key: 2]) {",
            "guard case let .someEnum(value) = aFunction([key: 2]) {",
            "for case let .someEnum(value) = aFunction([key: 2]) {"
        ],
        triggeringExamples: [
            "case 1: return true",
