reg
This commit is contained in:
1 parent
73fbba0d57
commit
b54805e513
1 file changed
+16
-16
@@ -118,24 +118,24 @@ func registerOneliners<T>(
|
||||
}
|
||||
|
||||
// Context field names for static type check
|
||||
struct F {
|
||||
static let count = "count"
|
||||
static let countText = "countText"
|
||||
static let didClickIncrement = "didClickIncrement"
|
||||
static let didLaunch = "didLaunch"
|
||||
static let didSetup = "didSetup"
|
||||
public struct F {
|
||||
public static let count = "count"
|
||||
public static let countText = "countText"
|
||||
public static let didClickIncrement = "didClickIncrement"
|
||||
public static let didLaunch = "didLaunch"
|
||||
public static let didSetup = "didSetup"
|
||||
|
||||
}
|
||||
struct RootContext: DialectContext {
|
||||
var count = Int()
|
||||
var countText = String()
|
||||
var didClickIncrement = Bool()
|
||||
var didLaunch = Bool()
|
||||
var didSetup = Bool()
|
||||
public struct RootContext: DialectContext {
|
||||
public var count = Int()
|
||||
public var countText = String()
|
||||
public var didClickIncrement = Bool()
|
||||
public var didLaunch = Bool()
|
||||
public var didSetup = Bool()
|
||||
|
||||
var recentField = ""
|
||||
public var recentField = ""
|
||||
|
||||
func field<T>(_ name: String) -> T {
|
||||
public func field<T>(_ name: String) -> T {
|
||||
if (name == "count") {
|
||||
return count as! T
|
||||
}
|
||||
@@ -155,7 +155,7 @@ struct RootContext: DialectContext {
|
||||
return "unknown-field-name" as! T
|
||||
}
|
||||
|
||||
mutating func setField(
|
||||
public mutating func setField(
|
||||
_ name: String,
|
||||
_ value: Any
|
||||
) {
|
||||
@@ -178,7 +178,7 @@ struct RootContext: DialectContext {
|
||||
}
|
||||
}
|
||||
|
||||
func rootSet(
|
||||
public func rootSet(
|
||||
_ key: String,
|
||||
_ value: Any
|
||||
) {
|
||||
|
||||
Reference in new issue
Block a user