From 603ca0f2def9591561bfe563b97bd44e2cb681d2 Mon Sep 17 00:00:00 2001 From: Cary R Date: Fri, 25 Apr 2008 14:26:17 -0700 Subject: [PATCH] Add better error recovery for failed task/function definition. This patch does a better job of recovering from an error in a task or function definition. This prevents the compiler from printing many irrelevant error messages. --- parse.y | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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