summaryrefslogtreecommitdiff
path: root/lib/sbin/CreateFunctionBindings.pl
diff options
context:
space:
mode:
authorhawke <hawke@17b73243-c579-4c4c-a9d2-2d5706c11dac>2004-12-15 16:10:35 +0000
committerhawke <hawke@17b73243-c579-4c4c-a9d2-2d5706c11dac>2004-12-15 16:10:35 +0000
commit1b70a5528c92b32e406b75c64749518c288c9d74 (patch)
tree6e14245e34748932238271504c1a2d61712e8cbd /lib/sbin/CreateFunctionBindings.pl
parent8e8c9a04b5d148572cfde05039c2569436047266 (diff)
Catch too many tokens in an argument problem for aliased
functions. This usually implies that an error was made, such as a comma being accidentally missed. Fixes PR 1886. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3933 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/CreateFunctionBindings.pl')
-rw-r--r--lib/sbin/CreateFunctionBindings.pl14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/sbin/CreateFunctionBindings.pl b/lib/sbin/CreateFunctionBindings.pl
index 7f8baeb3..3d49f79b 100644
--- a/lib/sbin/CreateFunctionBindings.pl
+++ b/lib/sbin/CreateFunctionBindings.pl
@@ -641,24 +641,24 @@ sub ParseArgument
my $Argument = {};
- my($type,$name,$fpointer,$intent);
+ my($type,$name,$fpointer,$intent,$extra);
if ($DummyArgument =~ /FPTRARGS/)
{
- ($type,$intent,$name) = split(' ',$DummyArgument);
+ ($type,$intent,$name,$extra) = split(' ',$DummyArgument);
# QUERY: is $fpointer supposed to be set here?
$fpointer = 1;
&debug_print("$Thorn--ParseArgument: (fn pointer) type=$type name=$name");
}
elsif ($DummyArgument =~ s/\bARRAY\b//)
{
- ($type,$intent,$name) = split(' ',$DummyArgument);
+ ($type,$intent,$name,$extra) = split(' ',$DummyArgument);
$Argument->{"Is Array"} = 1;
&debug_print("$Thorn--ParseArgument: $name is ARRAY");
}
else
{
- ($type,$intent,$name) = split(' ',$DummyArgument);
+ ($type,$intent,$name,$extra) = split(' ',$DummyArgument);
$Argument->{"Is Array"} = 0;
}
@@ -700,6 +700,12 @@ sub ParseArgument
&CST_error(0,$message,'',__LINE__,__FILE__);
}
+ if ($extra) # too many arguments; probably a comma missed (see PR 1886)
+ {
+ my $message = "Thorn $Thorn, Function $Function:\nThe argument has too many specifications: should be type - intent - name.\nThe argument \"$DummyArgument\" has too many.";
+ &CST_error(0,$message,'',__LINE__,__FILE__);
+ }
+
if ($fpointer)
{
$Argument->{"Function Pointer"} = 1;