From a136ca65ea6c116ac80182e1c8d679801981cf24 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Tue, 23 Jul 2013 20:43:15 -0500 Subject: [PATCH] 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. --- src/zscript/zcc-parse.lemon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/zscript/zcc-parse.lemon b/src/zscript/zcc-parse.lemon index c41b3671e..b1420c893 100644 --- a/src/zscript/zcc-parse.lemon +++ b/src/zscript/zcc-parse.lemon @@ -522,11 +522,11 @@ array_size(X) ::= array_size(A) array_size_expr(B). /* Multiple type names are only valid for functions. */ 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. X = NULL; } - else if (C.FuncParams != NULL) + else if (C.FuncName != NAME_None) { // A function NEW_AST_NODE(FuncDeclarator, decl); decl->Type = B;