allow the [cd]tor to take $L as an arcument as well
[apps/madmutt.git] / lib-lua / luapkg2c.pl
index 9ab8789..ac46db6 100755 (executable)
@@ -293,6 +293,7 @@ EOF
         put_line($p, 0);
         if ($t{type}->{dtor}) {
             my $dtor = $t{type}->{dtor};
+            $dtor =~ s/\$L/L/;
             $dtor =~ s/\$\$/\&$var/;
             print "    $dtor;\n";
         }
@@ -408,11 +409,13 @@ EOF
         print  "      case LTK_$tok: \n";
         if ($t{type}->{dtor}) {
             my $dtor = $t{type}->{dtor};
+            $dtor =~ s/\$L/L/;
             $dtor =~ s/\$\$/\&$var/;
             print "        $dtor;\n";
         }
         if ($t{type}->{ctor}) {
             my $ctor = $t{type}->{ctor};
+            $ctor =~ s/\$L/L/;
             $ctor =~ s/\$\$/$check/;
             $check = $ctor;
         }