From e3bc99dbf34d58bbc17cf462dd1040b5e16b7213 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sat, 26 Feb 2022 18:51:07 +0100 Subject: [PATCH] Don't allow non-ANSI ports for class constructors Class constructors don't allow for non-ANSI ports. E.g. the following is not valid. ``` class C; function new(); input int i; endfunction endclass ``` The parser will currently accept this, but otherwise ignore the non-ANSI port. Modify the parser rules so that this is a syntax error. Signed-off-by: Lars-Peter Clausen --- parse.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parse.y b/parse.y index 161512153..ff6c25f19 100644 --- a/parse.y +++ b/parse.y @@ -892,7 +892,7 @@ class_item /* IEEE1800-2005: A.1.8 */ current_function = pform_push_constructor_scope(@3); } '(' tf_port_list_opt ')' ';' - tf_item_list_opt + block_item_decls_opt statement_or_null_list_opt K_endfunction endnew_opt { current_function->set_ports($6);