diff --git a/parse.y b/parse.y index 7e33c76d2..4b79bb39b 100644 --- a/parse.y +++ b/parse.y @@ -1834,6 +1834,12 @@ module_item current_task = 0; delete[]$2; } + | K_task IDENTIFIER error K_endtask + { + pform_pop_scope(); + current_task = 0; + delete[]$2; + } /* The function declaration rule matches the function declaration header, then pushes the function scope. This causes the @@ -1871,6 +1877,12 @@ module_item current_function = 0; delete[]$3; } + | K_function function_range_or_type_opt IDENTIFIER error K_endfunction + { + pform_pop_scope(); + current_task = 0; + delete[]$3; + } /* A generate region can contain further module items. Actually, it is supposed to be limited to certain kinds of module items, but