Skip to content

Instantly share code, notes, and snippets.

@rurban
Created June 27, 2014 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rurban/3d7fac25d31785b472ac to your computer and use it in GitHub Desktop.
Save rurban/3d7fac25d31785b472ac to your computer and use it in GitHub Desktop.
pcc gh1080
my $sigtype = {'P' => 'pmc',
'S' => 'string',
'I' => 'integer',
'N' => 'number'};
my $arg_index = 0;
my @sig_vals = split(//, $params_signature);
my @params_vararg_list = split(/, &/,substr($params_varargs, 1));
foreach my $sig (@sig_vals) {
if ($sigtype{$sig}) {
my $type = $sigtype{$sig};
$e->emit( <<"END");
$params_vararg_list[$arg_index] = VTABLE_get_${type}_keyed_int(interp, _call_object, $arg_index);
END
$arg_index++;
}
else {
# TODO check for the other sig modifiers: i, o, s
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment