Skip to content

Commit

Permalink
improve defslatec debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
mohawk2 committed Dec 17, 2024
1 parent 14059c6 commit 513c0bd
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions slatec.pd
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,9 @@ sub defslatec {
die "Only one FuncRet allowed in pars list.\n"
if (my @funcret = grep $_->[0] eq "FuncRet", @args2) > 1;
my $fpar = @funcret ? "\$$funcret[0][2]()" : undef;
my $pars = join ';', map
+($KIND2I{$_->[0]}[0] // die "Invalid ppars ",join(',',@$_),"\n") . join('', @$_[1..3]),
my $pars = join '; ', map
+($KIND2I{$_->[0]}[0] // die "Invalid ppars ",join(',',@$_),"\n") .
join(' ', grep length, $_->[1], "$_->[2]$_->[3]"),
grep !$ignore_ppar{$_->[0]}, @args2;
my $otherpars = join ';', map
${$KIND2I{$_->[0]}[0]} . join(' => ', @$_[2,2]),
Expand Down Expand Up @@ -343,7 +344,7 @@ sub defslatec {
# add on the function reference, if supplied, to the start of
# the doc string
if ( defined $docstring ) {
$docstring = "\n=for ref\n\n$funcref\n\n$docstring" if defined $funcref;
$docstring = "=for ref\n\n$funcref\n\n$docstring" if defined $funcref;
} else {
$docstring = '';
}
Expand All @@ -352,13 +353,17 @@ sub defslatec {
my $code = join("\n", @intcopy_code, "$func($funcargs);");
print <<"ENDDBG" if $debug;
pp_def('$pname',
Pars => '$pars',
OtherPars => '$otherpars',@{[ !$argorder ? '' : "
Pars => '$pars',@{[ !$otherpars ? '' : "
OtherPars => '$otherpars',"]}@{[ !$argorder ? '' : "
ArgOrder => [qw(@$argorder)],"]}
Code => '$code',
Code => pp_line_numbers(__LINE__, <<'EOF'),
$code
EOF
CHeader => '@cheaders',
GenericTypes => [@{[join ", ", map $_->[0], @talts]}],
Doc => '$docstring',
GenericTypes => [qw(@{[join ", ", map $_->[0], @talts]})],
Doc => <<'EOF',
$docstring
EOF
);
ENDDBG
pp_def($pname,
Expand Down

0 comments on commit 513c0bd

Please # to comment.