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.
This commit is contained in:
parent
efba4bfd09
commit
603ca0f2de
12
parse.y
12
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
|
||||
|
|
|
|||
Loading…
Reference in New Issue