pike.git / src / language.yacc

version» Context lines:

pike.git/src/language.yacc:106:   %left TOK_LSH TOK_RSH   %left '+' '-'   %left '*' '%' '/'   %right TOK_NOT '~'   %nonassoc TOK_INC TOK_DEC      %{   /* This is the grammar definition of Pike. */      #include "global.h" - RCSID("$Id: language.yacc,v 1.290 2002/08/17 22:58:15 mast Exp $"); + RCSID("$Id: language.yacc,v 1.291 2002/08/27 12:37:09 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"   #include "program.h"   #include "pike_types.h"   #include "constants.h"   #include "pike_macros.h"   #include "pike_error.h"   #include "docode.h"   #include "machine.h"   #include "main.h"   #include "opcodes.h"   #include "operators.h" -  + #include "bignum.h"      #define YYMAXDEPTH 1000      #ifdef PIKE_DEBUG   #ifndef YYDEBUG   /* May also be defined by machine.h */   #define YYDEBUG 1   #endif /* YYDEBUG */   #endif   
pike.git/src/language.yacc:1337:   opt_int_range: /* Empty */    {    push_int_type(MIN_INT32, MAX_INT32);    }    | '(' number_or_minint expected_dot_dot number_or_maxint ')'    {    INT32 min = MIN_INT32;    INT32 max = MAX_INT32;       /* FIXME: Check that $4 is >= $2. */ -  if($4->token == F_CONSTANT && $4->u.sval.type == T_INT) -  { +  if($4->token == F_CONSTANT) { +  if ($4->u.sval.type == T_INT) {    max = $4->u.sval.u.integer; -  + #ifdef AUTO_BIGNUM +  } else if (is_bignum_object_in_svalue(&$4->u.sval)) { +  push_int(0); +  if (is_lt(&$4->u.sval, Pike_sp-1)) { +  max = MIN_INT32;    } -  +  pop_stack(); + #endif /* AUTO_BIGNUM */ +  } +  }    -  if($2->token == F_CONSTANT && $2->u.sval.type == T_INT) -  { +  if($2->token == F_CONSTANT) { +  if ($2->u.sval.type == T_INT) {    min = $2->u.sval.u.integer; -  + #ifdef AUTO_BIGNUM +  } else if (is_bignum_object_in_svalue(&$4->u.sval)) { +  push_int(0); +  if (is_lt(Pike_sp-1, &$4->u.sval)) { +  min = MAX_INT32;    } -  +  pop_stack(); + #endif /* AUTO_BIGNUM */ +  } +  }       push_int_type(min, max);       free_node($2);    free_node($4);    }    ;      opt_object_type: /* Empty */ { push_object_type(0, 0); }    | '(' program_ref ')'