mirror of
https://github.com/realm/SwiftLint.git
synced 2026-05-07 20:12:49 +00:00
6b094dd711
* [bazel] Remove custom SwiftSyntax BUILD file Something similar to this has been merged upstream instead now. This also renames the repo name to SwiftSyntax in preparation for it being in the BCR * [SwiftSyntax] Update to latest 509.0.0 tag https://github.com/apple/swift-syntax/releases/tag/509.0.0-swift-DEVELOPMENT-SNAPSHOT-2023-04-25-b
16 lines
604 B
Swift
16 lines
604 B
Swift
import SwiftIDEUtils
|
|
|
|
public 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
|
|
}
|
|
}
|
|
}
|