This commit is contained in:
Бондарев Иван 2018-04-17 21:48:29 +02:00
parent 88d6870f93
commit f3299e0667
3 changed files with 24 additions and 1 deletions

View file

@ -0,0 +1,18 @@
unit Data;
//обязательно params
procedure p2(params o: array of Exception) := exit;//не обязательно короткая процедура
procedure p1 :=//не обязательно короткая процедура
try
if true then
p2(nil);
except
//обязательно on do и использование переменной исключения в процедуре с params
on e: Exception do
p2(e);
end;
end.

View file

@ -903,7 +903,6 @@ namespace PascalABCCompiler.TreeConverter
vdn = syntax_tree_visitor.context.add_field(get_temp_arr_name(), loc, pr.type, polymorphic_state.ps_static);
else
vdn = syntax_tree_visitor.context.add_var_definition_in_entry_scope(get_temp_arr_name(), loc);
}
else if (syntax_tree_visitor.context.converted_type != null)
vdn = syntax_tree_visitor.context.add_field(get_temp_arr_name(), loc, pr.type, polymorphic_state.ps_static);

View file

@ -1798,6 +1798,12 @@ namespace PascalABCCompiler.TreeConverter
statement_node stm = convert_strong(eh.statements);
context.leave_code_block();
sl = convertion_data_and_alghoritms.statement_list_stack.pop();
if (sl.statements.Count > 0 || sl.local_variables.Count > 0)
{
sl.statements.AddElement(stm);
stm = sl;
}
exception_filter ef = new exception_filter(filter_type, lvr, stm, get_location(eh));
efl.AddElement(ef);
current_catch_excep = null;