Skip to content

Commit 271c38b

Browse files
authored
Merge pull request #7 from jimmya/master
Allow for raw switch cases
2 parents 6fa5325 + 298ecef commit 271c38b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Sources/Meta/Switch.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ extension SwitchCaseVariable: VariableValue {}
3131
public enum SwitchCaseName: Hashable, MetaSwiftConvertible {
3232
case `default`
3333
case custom(String)
34+
case raw(String)
3435
}
3536

3637
public struct SwitchCase: Hashable, MetaSwiftConvertible {
@@ -142,6 +143,8 @@ extension SwitchCaseName {
142143
return "default"
143144
case .custom(let name):
144145
return "case .\(name)"
146+
case .raw(let name):
147+
return "case \(name)"
145148
}
146149
}
147150
}

Tests/MetaTests/FileTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ final class FileTests: XCTestCase {
9494
let barID = TypeIdentifier(name: "Bar")
9595
let bar = Type(identifier: barID)
9696
.adding(inheritedType: .string)
97-
.with(kind: .enum)
97+
.with(kind: .enum(indirect: false))
9898
.with(accessLevel: .public)
9999
.adding(member: Case(name: "hello").with(value: .string("Hello")))
100100
.adding(member: Case(name: "world"))

0 commit comments

Comments
 (0)