Skip to content

Commit

Permalink
allow ; in addition to , #6
Browse files Browse the repository at this point in the history
  • Loading branch information
plicease committed Apr 21, 2015
1 parent 9d4b3bb commit aadad98
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Changes
@@ -1,5 +1,9 @@
Revision history for Perl module FFI::Platypus::Lang::Pascal

- Allow ; to separate types on the parameter list for unmangeled names
which is the norm for Pascal. (gh#6)
- Continue to allow , to separate types as well for backward compatability

0.04 Feb 17, 2015
- Fixed inconsistent versions from previous release

Expand Down
4 changes: 2 additions & 2 deletions lib/FFI/Platypus/Lang/Pascal.pm
Expand Up @@ -267,14 +267,14 @@ sub mangler
if($symbol =~ /^(.+)\((.*)\)$/)
{
my $name = uc $1;
my @args = map { uc $_ } split ',', $2;
my @args = map { uc $_ } split /;|,/, $2;
$name =~ s{\.}{_};
return join '$', $name, @args;
}
elsif($symbol =~ /^(.+)\((.*)\):(.*)$/)
{
my $name = uc $1;
my @args = map { uc $_ } split ',', $2;
my @args = map { uc $_ } split /;|,/, $2;
my $ret = uc $3;
$name =~ s{\.}{_};
return join '$', $name, @args, "\$$ret";
Expand Down
2 changes: 1 addition & 1 deletion t/ffi_platypus_attach.t
Expand Up @@ -21,7 +21,7 @@ subtest lib => sub {

subtest unit => sub {
plan skip_all => 'not the best way to do it';
$ffi->attach( ['Add.Add(SmallInt,SmallInt):SmallInt'=>'add'] => ['Integer', 'Integer'] => 'Integer');
$ffi->attach( ['Add.Add(SmallInt;SmallInt):SmallInt'=>'add'] => ['Integer', 'Integer'] => 'Integer');

is add(1,2), 3, 'add(1,2) = 3';

Expand Down

0 comments on commit aadad98

Please sign in to comment.