Skip to content

Commit

Permalink
Add support for static_assert declaration (#797)
Browse files Browse the repository at this point in the history
Co-authored-by: Zachary Jaquish <[email protected]>
Co-authored-by: John Fairhurst <[email protected]>
  • Loading branch information
3 people authored Dec 14, 2023
1 parent fc3dd66 commit 8abd090
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
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

0 comments on commit 8abd090

Please sign in to comment.