allow the [cd]tor to take $L as an arcument as well
authorPierre Habouzit <madcoder@debian.org>
Sun, 18 Mar 2007 16:41:15 +0000 (17:41 +0100)
committerPierre Habouzit <madcoder@debian.org>
Sun, 18 Mar 2007 16:41:15 +0000 (17:41 +0100)
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
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;
         }