Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for static_assert declaration #797

Merged
merged 3 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
* Added new syntax, attribute and declaration kinds introduced in Swift 5.8.
[JP Simard](https://github.com/jpsim)

* Added support for static\_assert declaration introduced in C11.
[Zach Jaquish](https://github.com/jaquish)

##### Bug Fixes

* Fix a crash when a file cannot be read as UTF-8.
Expand Down
3 changes: 3 additions & 0 deletions Source/SourceKittenFramework/ObjCDeclarationKind.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ public enum ObjCDeclarationKind: String {
case moduleImport = "sourcekitten.source.lang.objc.module.import"
/// `UnexposedDecl`
case unexposedDecl = "sourcekitten.source.lang.objc.decl.unexposed"
/// `static_assert`
case staticAssert = "sourcekitten.source.lang.objc.decl.static_assert"

// swiftlint:disable:next cyclomatic_complexity
public init(_ cursorKind: CXCursorKind) {
Expand All @@ -73,6 +75,7 @@ public enum ObjCDeclarationKind: String {
case CXCursor_ObjCCategoryImplDecl: self = .category
case CXCursor_ObjCDynamicDecl: self = .unexposedDecl
case CXCursor_ObjCSynthesizeDecl: self = .unexposedDecl
case CXCursor_StaticAssert: self = .staticAssert
default: fatalError("Unsupported CXCursorKind: \(clang_getCursorKindSpelling(cursorKind))")
}
}
Expand Down
Loading