diff --git a/Changes b/Changes index 6b16228..4c615fb 100644 --- a/Changes +++ b/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 diff --git a/lib/FFI/Platypus/Lang/Pascal.pm b/lib/FFI/Platypus/Lang/Pascal.pm index 5ee2c8e..ea7f1b7 100644 --- a/lib/FFI/Platypus/Lang/Pascal.pm +++ b/lib/FFI/Platypus/Lang/Pascal.pm @@ -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"; diff --git a/t/ffi_platypus_attach.t b/t/ffi_platypus_attach.t index d2cf41c..905f038 100644 --- a/t/ffi_platypus_attach.t +++ b/t/ffi_platypus_attach.t @@ -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';