mirror of
https://github.com/realm/SwiftLint.git
synced 2026-06-06 20:18:40 +00:00
https://github.com/apple/swift-syntax/releases/tag/509.0.0-swift-5.9-DEVELOPMENT-SNAPSHOT-2023-04-10-a
16 lines
592 B
Swift
16 lines
592 B
Swift
import IDEUtils
|
|
|
|
extension SyntaxClassification {
|
|
// True if it is any kind of comment.
|
|
var isComment: Bool {
|
|
switch self {
|
|
case .lineComment, .docLineComment, .blockComment, .docBlockComment:
|
|
return true
|
|
case .none, .keyword, .identifier, .typeIdentifier, .operatorIdentifier, .dollarIdentifier, .integerLiteral,
|
|
.floatingLiteral, .stringLiteral, .stringInterpolationAnchor, .poundDirectiveKeyword, .buildConfigId,
|
|
.attribute, .objectLiteral, .editorPlaceholder, .regexLiteral:
|
|
return false
|
|
}
|
|
}
|
|
}
|