pike.git / src / language.yacc

version» Context lines:

pike.git/src/language.yacc:181:   %left F_LSH F_RSH   %left '+' '-'   %left '*' '%' '/'   %right F_NOT '~'   %nonassoc F_INC F_DEC      %{   /* This is the grammar definition of Pike. */      #include "global.h" - RCSID("$Id: language.yacc,v 1.181 2000/07/09 18:32:53 grubba Exp $"); + RCSID("$Id: language.yacc,v 1.182 2000/08/16 12:56:47 grubba Exp $");   #ifdef HAVE_MEMORY_H   #include <memory.h>   #endif      #include "interpret.h"   #include "array.h"   #include "object.h"   #include "stralloc.h"   #include "las.h"   #include "interpret.h"
pike.git/src/language.yacc:1531:    }    ;      lambda: F_LAMBDA push_compiler_frame1    {    debug_malloc_touch(compiler_frame->current_return_type);    if(compiler_frame->current_return_type)    free_string(compiler_frame->current_return_type);    copy_shared_string(compiler_frame->current_return_type,any_type_string);    } -  func_args failsafe_block +  func_args    { -  +  $<number>$ = varargs; +  varargs = 0; +  } +  failsafe_block +  {    struct pike_string *type;    char buf[40];    int f,e;    struct pike_string *name;    -  debug_malloc_touch($5); -  $5=mknode(F_COMMA_EXPR,$5,mknode(F_RETURN,mkintnode(0),0)); -  type=find_return_type($5); +  debug_malloc_touch($6); +  $6=mknode(F_COMMA_EXPR,$6,mknode(F_RETURN,mkintnode(0),0)); +  type=find_return_type($6);       if(type) {    push_finished_type(type);    free_string(type);    } else    push_type(T_MIXED);       e=$4-1; -  if(varargs) +  if($<number>5)    {    push_finished_type(compiler_frame->variable[e].type);    e--; -  varargs=0; +     pop_type_stack();    }else{    push_type(T_VOID);    } -  +  varargs=0;    push_type(T_MANY);    for(; e>=0; e--)    push_finished_type(compiler_frame->variable[e].type);       push_type(T_FUNCTION);       type=compiler_pop_type();       sprintf(buf,"__lambda_%ld_%ld",    (long)new_program->id,    (long)(local_class_counter++ & 0xffffffff)); /* OSF/1 cc bug. */    name=make_shared_string(buf);      #ifdef LAMBDA_DEBUG    fprintf(stderr, "%d: LAMBDA: %s 0x%08lx 0x%08lx\n",    compiler_pass, buf, (long)new_program->id, local_class_counter-1);   #endif /* LAMBDA_DEBUG */       f=dooptcode(name, -  $5, +  $6,    type,    ID_STATIC | ID_PRIVATE | ID_INLINE);       if(compiler_frame->lexical_scope == 2) {    $$ = mktrampolinenode(f);    } else {    $$ = mkidentifiernode(f);    }    free_string(name);    free_string(type);