diff --git a/Plugins/Libraries/LighterCodeGenAST/Nodes/Expression.swift b/Plugins/Libraries/LighterCodeGenAST/Nodes/Expression.swift index 8c234ee..bf8e7cc 100644 --- a/Plugins/Libraries/LighterCodeGenAST/Nodes/Expression.swift +++ b/Plugins/Libraries/LighterCodeGenAST/Nodes/Expression.swift @@ -194,7 +194,16 @@ public extension Expression { static func variable(_ name: String) -> Self { .variableReference(instance: nil, name: name) } - + + /// A variable (inout) reference, e.g. `&self.sql`. + static func variableRef(_ instance: String, _ name: String) -> Self { + .raw("&\(instance).\(name)") // TODO: add expr + } + /// A variable (inout) reference, e.g. `&self.sql`. + static func variableRef(_ name: String) -> Self { + .raw("&\(name)") // TODO: add expr + } + /// A KeyPath expression. static func keyPath(_ baseType: TypeReference? = nil, _ property: String) -> Self