Swift: Autoformat.

This commit is contained in:
Geoffrey White
2023-03-03 16:24:28 +00:00
parent 234f17b578
commit 6e3040987a
2 changed files with 8 additions and 19 deletions

View File

@@ -26,9 +26,7 @@ class PointerType extends Type {
* `UnsafeMutablePointer` or `UnsafeBufferPointer`.
*/
class UnsafeTypedPointerType extends BoundGenericType {
UnsafeTypedPointerType() {
this.getName().regexpMatch("Unsafe(Mutable|)(Buffer|)Pointer<.*")
}
UnsafeTypedPointerType() { this.getName().regexpMatch("Unsafe(Mutable|)(Buffer|)Pointer<.*") }
}
/**
@@ -36,18 +34,14 @@ class UnsafeTypedPointerType extends BoundGenericType {
* `UnsafeMutableRawPointer` or `UnsafeRawBufferPointer`.
*/
class UnsafeRawPointerType extends NominalType {
UnsafeRawPointerType() {
this.getName().regexpMatch("Unsafe(Mutable|)Raw(Buffer|)Pointer")
}
UnsafeRawPointerType() { this.getName().regexpMatch("Unsafe(Mutable|)Raw(Buffer|)Pointer") }
}
/**
* A Swift `OpaquePointer`.
*/
class OpaquePointerType extends NominalType {
OpaquePointerType() {
this.getName() = "OpaquePointer"
}
OpaquePointerType() { this.getName() = "OpaquePointer" }
}
/**
@@ -63,25 +57,19 @@ class AutoreleasingUnsafeMutablePointerType extends BoundGenericType {
* A Swift `Unmanaged` object reference.
*/
class UnmanagedType extends BoundGenericType {
UnmanagedType() {
this.getName().matches("Unmanaged<%")
}
UnmanagedType() { this.getName().matches("Unmanaged<%") }
}
/**
* A Swift `CVaListPointer`.
*/
class CVaListPointerType extends NominalType {
CVaListPointerType() {
this.getName() = "CVaListPointer"
}
CVaListPointerType() { this.getName() = "CVaListPointer" }
}
/**
* A Swift `ManagedBufferPointer`.
*/
class ManagedBufferPointerType extends BoundGenericType {
ManagedBufferPointerType() {
this.getName().matches("ManagedBufferPointer<%")
}
ManagedBufferPointerType() { this.getName().matches("ManagedBufferPointer<%") }
}

View File

@@ -12,7 +12,8 @@ string describe(Type t) {
or
t instanceof OpaquePointerType and result = "OpaquePointerType"
or
t instanceof AutoreleasingUnsafeMutablePointerType and result = "AutoreleasingUnsafeMutablePointerType"
t instanceof AutoreleasingUnsafeMutablePointerType and
result = "AutoreleasingUnsafeMutablePointerType"
or
t instanceof UnmanagedType and result = "UnmanagedType"
or