-
Notifications
You must be signed in to change notification settings - Fork 15
Refactor codegen_c_hdr.pl for improved clarity #71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the reason for these changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.