X-Git-Url: http://deadsoftware.ru/gitweb?p=dsw-obn.git;a=blobdiff_plain;f=src%2Foberon.c;h=66a3c7025056b195a204386c126024933c4ebca3;hp=58eb67c3eb72562294074f972fde2e15f68b5fec;hb=6e0d9d632fdf070f9777fe90b9add849562acaf2;hpb=55d9ee92b95dd306ac80fb643ed21d3b733395d7 diff --git a/src/oberon.c b/src/oberon.c index 58eb67c..66a3c70 100644 --- a/src/oberon.c +++ b/src/oberon.c @@ -2469,13 +2469,20 @@ oberon_proc_decl(oberon_context_t * ctx) signature = oberon_new_type_ptr(OBERON_TYPE_VOID); oberon_opt_formal_pars(ctx, &signature); - oberon_initialize_decl(ctx); + //oberon_initialize_decl(ctx); oberon_generator_init_type(ctx, signature); oberon_close_scope(ctx -> decl); oberon_object_t * proc; proc = oberon_find_object(ctx -> decl, name, 0); - if(proc != NULL) + if(proc == NULL) + { + proc = oberon_define_object(ctx -> decl, name, OBERON_CLASS_PROC, export, read_only, false); + proc -> type = signature; + proc -> scope = proc_scope; + oberon_generator_init_proc(ctx, proc); + } + else { if(proc -> class != OBERON_CLASS_PROC) { @@ -2497,16 +2504,15 @@ oberon_proc_decl(oberon_context_t * ctx) oberon_compare_signatures(ctx, proc -> type, signature); } - else + + proc_scope -> parent = proc; + oberon_object_t * param = proc_scope -> list -> next; + while(param) { - proc = oberon_define_object(ctx -> decl, name, OBERON_CLASS_PROC, export, read_only, false); - proc -> type = signature; - proc -> scope = proc_scope; - oberon_generator_init_proc(ctx, proc); + param -> parent = proc; + param = param -> next; } - proc -> scope -> parent = proc; - if(forward == 0) { proc -> linked = 1;