mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-14 00:21:34 +00:00
Allow functions without parameters
- Fixed: Trying to define a function without any parameters would silently discard the function, because the declarator tested FuncParams instead of FuncName to decide if it was a function.
This commit is contained in:
parent
67caf3303b
commit
a136ca65ea
1 changed files with 2 additions and 2 deletions
|
@ -522,11 +522,11 @@ array_size(X) ::= array_size(A) array_size_expr(B).
|
||||||
/* Multiple type names are only valid for functions. */
|
/* Multiple type names are only valid for functions. */
|
||||||
declarator(X) ::= decl_flags(A) type_list_or_void(B) variables_or_function(C).
|
declarator(X) ::= decl_flags(A) type_list_or_void(B) variables_or_function(C).
|
||||||
{
|
{
|
||||||
if (C.FuncParams == NULL && C.VarNames == NULL)
|
if (C.FuncName == NAME_None && C.VarNames == NULL)
|
||||||
{ // An error. A message was already printed.
|
{ // An error. A message was already printed.
|
||||||
X = NULL;
|
X = NULL;
|
||||||
}
|
}
|
||||||
else if (C.FuncParams != NULL)
|
else if (C.FuncName != NAME_None)
|
||||||
{ // A function
|
{ // A function
|
||||||
NEW_AST_NODE(FuncDeclarator, decl);
|
NEW_AST_NODE(FuncDeclarator, decl);
|
||||||
decl->Type = B;
|
decl->Type = B;
|
||||||
|
|
Loading…
Reference in a new issue