-
-
Save Skarsnik/f3adb82dcc630b6a401b3a697d01838b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub fix-struct-name {# CASTXML does not give a name to struct defined like typedef struct {} name | |
say "fix stuff"; | |
for %structs.keys -> $id { | |
next if %structs{$id} !~~ Struct; | |
say %structs{$id}; | |
if %structs{$id}.name eq $PLACEHOLDER { | |
for @typedefs -> $td { | |
if $td.ref-id eq $id { | |
say "merging struct ", $id , " with typedef ", $td.id; | |
%structs{$id}.name = $td.name; | |
%structs{$id}.id = $td.id; | |
%types{$id}.id = $td.id; | |
%types{$id}.name = $td.name; | |
%types{$td.id} = %types{$id}; | |
%types{$id}:delete; | |
%structs{$td.id} = %structs{$id}; | |
%structs{$id}:delete; | |
@typedefs.splice(@typedefs.first($td, :k), 1); | |
last; | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment