changeset 381:874577d7505f

fix parse for interface
author anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Mon, 20 Jul 2020 15:00:11 +0900
parents 8f2bc03fcbb2
children 663e69a94246
files src/gearsTools/lib/Gears/Util.pm
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/gearsTools/lib/Gears/Util.pm	Mon Jul 20 14:14:24 2020 +0900
+++ b/src/gearsTools/lib/Gears/Util.pm	Mon Jul 20 15:00:11 2020 +0900
@@ -85,11 +85,12 @@
       next if $static_data_gear_write_mode;
       my $args = $';
       #$args eq  (Impl* vm, pde_t* pgdir, char* init, uint sz, __code next(...));
-      while ($args =~ /\s*(struct|union|const|enum)?\s*([\w*\[\]_]+)\s*(\w+),?/g) {
+      while ($args =~ /\s*(struct|union|const|enum)?\s*([\w*\[\]_]+)\s*(\w+)?,/g) {
         my $const_type = $1;
         my $type = $2;
         my $vname = $3;
         next if ($type eq '__code');
+        next unless $vname; # __code hoge(int ret, __code next(ret, ...); this is second "ret" case
         $type =~ s/^(?:Impl|Type|Isa)\s*(\*)?/union Data$1/;
         my $val = "$type $vname;\n";
         push(@tmp_args, $const_type ?  "$const_type $val" : $val);