Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
christiangnrd committed Dec 10, 2024
1 parent 3350430 commit 06daaf3
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions res/wrap/wrap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -198,18 +198,20 @@ function create_objc_context(headers::Vector, args::Vector=String[], options::Di
end

function rewriter!(ctx, options)
for node in get_nodes(ctx.dag)
if typeof(node) <: Generators.ExprNode{<:Generators.AbstractStructNodeType}
expr = node.exprs[1]
structName = String(expr.args[2])

if haskey(options["api"], structName)
# Add default constructer to some structs
if haskey(options["api"][structName], "constructor")
expr = node.exprs[1]
con = options["api"][structName]["constructor"] |> Meta.parse

push!(expr.args[3].args, con)
if haskey(options, "api")
for node in get_nodes(ctx.dag)
if typeof(node) <: Generators.ExprNode{<:Generators.AbstractStructNodeType}
expr = node.exprs[1]
structName = String(expr.args[2])

if haskey(options["api"], structName)
# Add default constructer to some structs
if haskey(options["api"][structName], "constructor")
expr = node.exprs[1]
con = options["api"][structName]["constructor"] |> Meta.parse

push!(expr.args[3].args, con)
end
end
end
end
Expand Down

0 comments on commit 06daaf3

Please sign in to comment.