Refactor codegen_c_hdr.pl for improved clarity#71
Refactor codegen_c_hdr.pl for improved clarity#71klefo0 wants to merge 1 commit intoDFHack:masterfrom
Conversation
| @ARGV = grep { $_ ne '--32' } @ARGV if $bin32; | ||
|
|
||
| my $input = $ARGV[0] || 'codegen/codegen.out.xml'; | ||
| my $input = $ARGV[0] || 'codegen.out.xml'; |
There was a problem hiding this comment.
I believe this script is intended to be run from the df-structures root, where codegen/codegen.out.xml is the correct path if codegen.pl is run with default arguments.
There was a problem hiding this comment.
but i only found the codegen.out.xml in df's include folder, there isn't codegen/codegen.out.xml
There was a problem hiding this comment.
Historically, this tool has been run against a copy of the df-structures repo, with codegen.pl run with default arguments, which results in codegen.out.xml being placed in the codegen subfolder. DF build scripting runs codegen.pl with nondefault arguments and is not the default use case here.
| my ($item, $name) = @_; | ||
|
|
||
| my $subtype = $item->getAttribute('ld:subtype'); | ||
| my $subtype = $item->getAttribute('ld:subtype') || ''; |
There was a problem hiding this comment.
if ld:subtype was required before, this probably means some new type we have added isn't generating it, and we should fix that instead.
| render_item($tg, "*${name}"); | ||
| } else { | ||
| render_item($tg, "${name}[$count]"); | ||
| render_item($tg, $name . "[$count]"); |
There was a problem hiding this comment.
what's the reason for these changes?
There was a problem hiding this comment.
there is an error like this Global symbol "@name" requires explicit package name (did you forget to declare "my @name"?) at E:\Development\OnGoing_Project\dfhack\library\include\df\codegen_c_hdr.pl line 665. so i need to change that to new format
No description provided.