File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
lib/ASTGen/Sources/ASTGen Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -17,15 +17,21 @@ extension UnsafePointer {
17
17
}
18
18
}
19
19
20
- // TODO: :(
21
- var declContext : UnsafeMutableRawPointer ! = nil
20
+ /// Little utility wrapper that lets us
21
+ @propertyWrapper
22
+ class Boxed < Value> {
23
+ var wrappedValue : Value
24
+
25
+ init ( wrappedValue: Value ) {
26
+ self . wrappedValue = wrappedValue
27
+ }
28
+ }
22
29
23
30
struct ASTGenVisitor : SyntaxTransformVisitor {
24
31
let ctx : UnsafeMutableRawPointer
25
32
let base : UnsafePointer < CChar >
26
33
27
- // TOOD: we need to be up updating this.
28
- // var declContext: UnsafeMutableRawPointer
34
+ @Boxed var declContext : UnsafeMutableRawPointer
29
35
30
36
// TODO: this some how messes up the witness table when I uncomment it locally :/
31
37
// public func visit<T>(_ node: T?) -> [UnsafeMutableRawPointer]? {
@@ -70,8 +76,7 @@ public func parseTopLevelSwift(
70
76
callback: @convention ( c) ( UnsafeMutableRawPointer , UnsafeMutableRawPointer ) -> Void
71
77
) {
72
78
let syntax = try ! Parser . parse ( source: String ( cString: buffer) )
73
- declContext = dc
74
- ASTGenVisitor ( ctx: ctx, base: buffer)
79
+ ASTGenVisitor ( ctx: ctx, base: buffer, declContext: dc)
75
80
. visit ( syntax)
76
81
. forEach { callback ( $0, outputContext) }
77
82
}
You can’t perform that action at this time.
0 commit comments